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'
}
});| Option | Type | Default | Description |
|---|---|---|---|
port | number | 3000 | Port the server listens on |
host | string | '0.0.0.0' | Interface to bind to |
Database
config.js
crescent.config({
database: {
file: 'crescent.db',
auto_create: true
}
});| Option | Type | Default | Description |
|---|---|---|---|
file | string | 'crescent.db' | Database file path |
auto_create | boolean | true | Create the file if missing |
Authentication
config.js
crescent.config({
auth: {
secret: 'change-me',
token_expiry: '7d',
oauth: {
google: { client_id: '...', client_secret: '...' }
}
}
});| Option | Type | Default | Description |
|---|---|---|---|
secret | string | - | Signing secret for tokens |
token_expiry | string | '7d' | Token lifetime |
oauth | object | - | 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
- Deployment Guide — ship your app to production
- API Reference — explore every method