Skip to content

Config

Configurations are used to set up the server and database. The configurations are stored in a JSON file called config.json in the root directory of the project.

Config variables

KeyTypeDefaultReqiuredDescription
corsString[]falseComma separated list of domains to allow CORS requests from
databaseObjectfalseName of the database to use
jwtSecretStringRandom UUIDfalseSecret key used to sign/verify JWT tokens
isDemobooleanfalsefalseSet to enabled to enable demo mode
migrationTypeString"automatic"falseType of migration to run. Can be either "automatic" or "manual"
portNumber2308falsePort to run the server on
versionStringCurrent version of npm packagefalseVersion of Lunalytics, used to apply migrations scripts for database

Example config.json

json
{
  "jwtSecret": "lunalyticsJwtSecretKeyHerePlease",
  "port": 2308,
  "database": { "name": "lunalytics" },
  "isDemo": false,
  "cors": ["http://localhost:3000", "http://localhost:8080"],
  "version": "0.6.0"
}