Configuration
NeatNode templates come preconfigured, but you can adjust settings via config files and environment variables.
Environment Variables
Each template includes a .env.example file. Copy and rename it:
cp .env.example .envCommon variables:
| Variable | Description | Default |
|---|---|---|
PORT | Server port | 5000 |
NODE_ENV | Environment mode | development |
DB_URL | Database connection string | — |
JWT_SECRET | Secret for JWT tokens | — |
Config Files
| File | Location | Purpose |
|---|---|---|
db.js | src/config/ | Database connection logic |
logger.js | src/config/ | Winston or console logger |
socket.js | src/config/ | Socket.IO initialization |
cors.js | src/config/ | CORS options |
TypeScript Config
TypeScript templates include a tsconfig.json with:
- Strict mode enabled
- ES module output
- Path aliases configured
- Source maps for debugging
Customizing Config
All config files are in src/config/. You can:
- Modify existing files directly
- Add new config modules (Redis, mail, etc.)
- Import them in
server.jsorapp.js
See Customization Guide for detailed examples.