123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import * as dotenv from "dotenv"
- process.env.NODE_ENV = process.env.NODE_ENV || "development"
- const envFound = dotenv.config()
- if (envFound.error) {
- throw new Error("⚠️ Couldn't find .env file ⚠️")
- }
- export default {
- port: parseInt(process.env.PORT, 10),
- databaseURL: process.env.MONGODB_URI,
- jwtSecret: process.env.JWT_SECRET,
- jwtAlgorithm: process.env.JWT_ALGO,
- options: {
- swaggerDefinition: {
- info: {
- description: 'This is a server',
- title: 'Swagger',
- version: '1.0.0'
- },
- host: `localhost:${parseInt(process.env.PORT, 10)}`,
- basePath: '/',
- produces: ['application/json', 'application/xml'],
- schemes: ['http', 'https'],
- securityDefinitions: {
- JWT: {
- type: 'apiKey',
- in: 'header',
- name: 'Authorization',
- description: ''
- }
- }
- },
- route: {
- url: './swagger-ui.html',
- docs: '/swagger.json' //swagger文件 api
- },
- basedir: __dirname, //app absolute path
- files: ['../router/api/*.ts'] //Path to the API handle folder
- },
- logs: {
- level: process.env.LOG_LEVEL || 'silly',
- },
- agenda: {
- dbCollection: process.env.AGENDA_DB_COLLECTION,
- pooltime: process.env.AGENDA_POOL_TIME,
- concurrency: parseInt(process.env.AGENDA_CONCURRENCY, 10),
- },
- mysql: {
- host: 'localhost',
- charset: 'utf8_general_ci',
- user: 'root',
- password: 'admin'
- },
- mongodb: {},
- sqlite: {},
- api: {
- prefix: '/api',
- },
- emails: {
- apiKey: process.env.MAILGUN_API_KEY,
- domain: process.env.MAILGUN_DOMAIN
- }
- }
|