Environment variables

Rakkas handles environment variables the same way as Vite, which means process.env and {"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true} will be expanded in build-time. This causes problems if you want to use environment variables for configuration because you will have to rebuild your app every time you change an environment variable.

There is an open issue on the Vite side about this limitation. One way around it is to use (0, eval)("process.env") for the time being to access the real runtime environment variables from server-side code.

Configuration through environment variables

A Rakkas production server supports the following environment variables:

VariableDescription
TRUST_FORWARDED_ORIGINWhether to trust x-forwarded-* headers
HOSTServer host
PORTHTTP port