mirror of
https://github.com/pure-admin/pure-admin-backend.git
synced 2025-04-24 23:37:17 +08:00
70 lines
1.7 KiB
TypeScript
70 lines
1.7 KiB
TypeScript
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: "HOUKONG",
|
|
title: "Swagger",
|
|
version: require("../../package.json").version,
|
|
},
|
|
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: "Bearer Authorization",
|
|
},
|
|
},
|
|
},
|
|
route: {
|
|
url: "./swagger-ui.html",
|
|
// swagger文件 api
|
|
docs: "/swagger.json",
|
|
},
|
|
// app absolute path
|
|
basedir: __dirname,
|
|
// path to the API handle folder
|
|
files: ["../router/*.ts"],
|
|
},
|
|
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: "43.156.106.134",
|
|
charset: "utf8_general_ci",
|
|
user: "houkong",
|
|
password: "P@55w0rd",
|
|
database: "houkong",
|
|
},
|
|
mongodb: {},
|
|
sqlite: {},
|
|
api: {
|
|
prefix: "/api",
|
|
},
|
|
emails: {
|
|
apiKey: process.env.MAILGUN_API_KEY,
|
|
domain: process.env.MAILGUN_DOMAIN,
|
|
},
|
|
};
|