rsnext/examples/custom-server-hapi
2021-08-17 09:18:08 +02:00
..
pages Fixes Hapi custom server example (#15292) 2020-07-21 13:27:39 -04:00
public Fixes Hapi custom server example (#15292) 2020-07-21 13:27:39 -04:00
.gitignore Added .gitignore to examples that are deployed to vercel (#15127) 2020-07-16 10:52:23 -04:00
next-wrapper.js Update to latest babel versions (#28174) 2021-08-17 09:18:08 +02:00
package.json Remove licence from all example/package.json that has them (#28007) 2021-08-14 10:48:39 -05:00
README.md docs: add 'Open in StackBlitz' buttons to various examples (#25853) 2021-06-08 20:45:02 +00:00
server.js Update custom server examples (#24814) 2021-05-07 18:50:56 +02:00

Custom server using Hapi example

Most of the time the default Next.js server will be enough but there are times you'll want to run your own server to integrate into an existing application. Next.js provides a custom server api.

Because the Next.js server is a Node.js module you can combine it with any other part of the node.js ecosystem. In this case we are using Hapi.

Preview

Preview the example live on StackBlitz:

Open in StackBlitz

How to use

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example custom-server-hapi custom-server-hapi-app
# or
yarn create next-app --example custom-server-hapi custom-server-hapi-app