Browse Source

添加生产环境的配置;

lrf 3 years ago
parent
commit
af6ae29072
2 changed files with 19 additions and 1 deletions
  1. 18 0
      config/config.prod.js
  2. 1 1
      server.js

+ 18 - 0
config/config.prod.js

@@ -0,0 +1,18 @@
+'use strict';
+
+module.exports = () => {
+  const config = exports = {};
+  config.dbName = 'question';
+  config.mongoose = {
+    url: `mongodb://localhost:27017/${config.dbName}`,
+    options: {
+      user: 'admin',
+      pass: 'admin',
+      authSource: 'admin',
+      useNewUrlParser: true,
+      useCreateIndex: true,
+    },
+  };
+  
+  return config;
+};

+ 1 - 1
server.js

@@ -2,7 +2,7 @@
 // eslint-disable-next-line strict
 const egg = require('egg');
 
-const workers = Number(2);
+const workers = Number(1);
 egg.startCluster({
   workers,
   baseDir: __dirname,