Skip to content
Gravity Logo / Docs Gravity home
Browse documentation
Documentation/Gravity Web

Deployment

From client/, build the web client and serve the production bundle:

npm run build
npm start

Vite writes the static site to client/dist/. The start script serves that directory with SPA fallback. Use npm run serve for a local Vite preview. The repository also supplies a heroku-postbuild script.

To host the bundle elsewhere, publish dist/ and configure the host to serve index.html for client-side routes. Set production.server_url in src/settings.json before building. If the API and client share a host, route API requests to Gravity Server before applying the SPA fallback. Configure server environment variables separately.

Watch the Heroku deployment tutorial