# How to get the hapi server object in the latest version

**URL:** <https://discuss.elastic.co/t/how-to-get-the-hapi-server-object-in-the-latest-version/294905>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [January 20, 2022, 8:04am UTC](https://discuss.elastic.co/t/how-to-get-the-hapi-server-object-in-the-latest-version/294905 "2022-01-20T08:04:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![qixian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qixian/32/97437_2.png) [@qixian](https://discuss.elastic.co/u/qixian)\
**Post date:** [January 20, 2022, 8:04am UTC](https://discuss.elastic.co/t/how-to-get-the-hapi-server-object-in-the-latest-version/294905/1 "2022-01-20T08:04:27Z")

</div>

At the kibana 6.4,when i develop the custom plugin,I can use the hapi server object like this ,  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/9/d93dcd7a3f839309b2b7a6ff1c61ea528a75d2fa.png)  
but at the latest kibana version,how can i get the hapi server object ?Do I need to pull in the http\_server.js?

---

<div class="post-metadata">

**Author:** ![cheiligers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheiligers/32/73114_2.png) [@cheiligers](https://discuss.elastic.co/u/cheiligers)\
**Post date:** [January 20, 2022, 8:38pm UTC](https://discuss.elastic.co/t/how-to-get-the-hapi-server-object-in-the-latest-version/294905/2 "2022-01-20T20:38:58Z")

</div>

@qixian Kibana's changed a lot since 6.4 and the latest version doesn't expose the underlying Hapi server on purpose. In the new platform, all the underlying hapi server methods are now exposed through `CoreSetup`. To help folks navigate the new way of doing things, we've written a guide and tried to give as many [examples](https://www.elastic.co/guide/en/kibana/current/migrating-legacy-plugins-examples.html#http-routes-migration) as possible. There's even one for migrating [hapi pre-handlers](https://www.elastic.co/guide/en/kibana/current/migrating-legacy-plugins-examples.html#_migrating_hapi_pre_handlers)!

There's a lot more in those docs that we hope will help. Good luck!

---

<div class="post-metadata">

**Author:** ![qixian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qixian/32/97437_2.png) [@qixian](https://discuss.elastic.co/u/qixian)\
**Post date:** [January 21, 2022, 3:56am UTC](https://discuss.elastic.co/t/how-to-get-the-hapi-server-object-in-the-latest-version/294905/3 "2022-01-21T03:56:48Z")

</div>

I hava looked at the docs，is there no way to access the hapi server object?

---

<div class="post-metadata">

**Author:** ![cheiligers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheiligers/32/73114_2.png) [@cheiligers](https://discuss.elastic.co/u/cheiligers)\
**Post date:** [January 21, 2022, 5:30pm UTC](https://discuss.elastic.co/t/how-to-get-the-hapi-server-object-in-the-latest-version/294905/4 "2022-01-21T17:30:26Z")

</div>

No, you have to use core services.

---

<div class="post-metadata">

**Author:** ![qixian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qixian/32/97437_2.png) [@qixian](https://discuss.elastic.co/u/qixian)\
**Post date:** [January 22, 2022, 9:32am UTC](https://discuss.elastic.co/t/how-to-get-the-hapi-server-object-in-the-latest-version/294905/5 "2022-01-22T09:32:04Z")

</div>

ok,thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 19, 2022, 9:32am UTC](https://discuss.elastic.co/t/how-to-get-the-hapi-server-object-in-the-latest-version/294905/6 "2022-02-19T09:32:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
