🔏
starhackit
  • README
  • Getting started
    • Requirements
    • Quick Start
  • Frontend
    • The Frontend
      • Npm scripts
    • Unit testing
    • End 2 End Testing
    • Multi Application
    • Production Build
    • Internationalization
    • Configuration
    • Cut and Paste detector
    • Webpack
  • Backend
    • Node Backend
      • Npm scripts
    • Development Enviromnent with docker-compose
    • Testing
      • Code Coverage
    • Configuration
    • Debugging
    • Database
    • Http Server
      • CORS
    • Authentication
      • Social Authentication
      • Local Authentication with JWT
    • Email
    • Redis
    • Api Model
      • Api Mocking
  • Deployment
    • Build, Tag and Push Docker Images
    • Releasing
    • Deploy Infrastructure with GruCloud
    • Deploy with Ansible
Powered by GitBook
On this page

Was this helpful?

  1. Backend

Configuration

PreviousCode CoverageNextDebugging

Last updated 5 years ago

Was this helpful?

This project uses the library which supports config file hierarchy and the NODE_CONFIG environment variable.

Example of :

{
  "websiteUrl": "http://localhost:8080",
  "log": {
    "console": {
      "level": "debug",
      "timestamp": true,
      "colorize": true
    }
  },
  "redis":{
    "url": "//localhost:7379"
  },
  "koa": {
    "port": 9000,
    "apiBasePath": "/api/v1/",
    "cookieSecret": ["your-super-session-secret"],
    "staticContent": ["build"],
    "logger": true,
    "cors":{
      "credentials": true
    }
  },
  "db":{
    "url": "postgres://postgres:password@localhost:6432/dev?sslmode=disable",
    "options": {
      "logging": true
    }
  },
  "jwt": {
    "secret": "I love shrimp with mayonnaise",
    "options": {
      "expiresIn": "15 days"
    }
  },
  "mail": {
    "from": "StarHackIt <notification@starhack.it>",
    "signature": "The Team",
    "smtp": {
      "service": "Mailgun",
      "auth": {
        "user": "postmaster@yourproject.mailgun.org",
        "pass": "11111111111111111111"
      }
    }

  }
}
node-config
the default config file