Crescent.js logoCrescent.jsv1.0.3
Reference

Configuration

Tune the server, database, authentication, and build options for your app.

Overview

Crescent.js is designed to work with sensible defaults, but you can customize everything from the running port to how the database behaves.

Server

config.js
crescent.config({
  server: {
    port: 3030,
    host: '0.0.0.0'
  }
});
OptionTypeDefaultDescription
portnumber3000Port the server listens on
hoststring'0.0.0.0'Interface to bind to

Database

config.js
crescent.config({
  database: {
    file: 'crescent.db',
    auto_create: true
  }
});
OptionTypeDefaultDescription
filestring'crescent.db'Database file path
auto_createbooleantrueCreate the file if missing

Authentication

config.js
crescent.config({
  auth: {
    secret: 'change-me',
    token_expiry: '7d',
    oauth: {
      google: { client_id: '...', client_secret: '...' }
    }
  }
});
OptionTypeDefaultDescription
secretstring-Signing secret for tokens
token_expirystring'7d'Token lifetime
oauthobject-OAuth provider credentials

Change the default secret

The default auth secret is a placeholder. Always set a unique secret before deploying to production.

Next Steps