Community-led documentation about using hapi with Vike.

💚
This page may contain outdated information, PR welcome to update or improve this page.

We recommend the following setup.

In development, we use two servers:

  1. We use Vite's development server ($ vite). (It automatically includes Vike).
  2. We use our hapi server without Vite nor Vike.

This means that in development, Vite is responsible for serving the entire frontend, while our hapi server is responsible only for serving the backend.

When using Express.js we usually integrate the Vite development middleware to Express.js but we cannot do that with hapi, because hapi doesn't support connect middlewares (the Vite development middleware is a connect middleware). See

In production, we use only one server:

  1. Our hapi server that serves the backend as well as the frontend: it serves the static files living at dist/client/ and does server-side rendering by using Vike's renderPage().

See GitHub > vikejs/vike > hapi (#366).