소스 검색

first commit

dygapp 7 년 전
부모
커밋
1217ae6e61
6개의 변경된 파일39개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      .eslintrc
  2. 1 1
      app/controller/home.js
  3. 12 0
      config/config.default.js
  4. 19 0
      config/config.prod.js
  5. 4 0
      config/plugin.js
  6. 2 1
      package.json

+ 1 - 1
.eslintrc

@@ -1,3 +1,3 @@
 {
-  "extends": "eslint-config-egg"
+  "extends": "eslint-config-egg-naf"
 }

+ 1 - 1
app/controller/home.js

@@ -4,7 +4,7 @@ const Controller = require('egg').Controller;
 
 class HomeController extends Controller {
   async index() {
-    this.ctx.body = 'hi, egg';
+    this.ctx.body = 'smart jobs platform user service';
   }
 }
 

+ 12 - 0
config/config.default.js

@@ -9,5 +9,17 @@ module.exports = appInfo => {
   // add your config here
   config.middleware = [];
 
+  // mongoose config
+  config.mongoose = {
+    // url: 'mongodb://root:Ziyouyanfa%23%40!@localhost:27017/naf?authSource=admin',
+    url: 'mongodb://localhost:27017/platform',
+    options: {
+      useMongoClient: true,
+      user: 'root',
+      pass: 'Ziyouyanfa#@!',
+      authSource: 'admin',
+    },
+  };
+
   return config;
 };

+ 19 - 0
config/config.prod.js

@@ -0,0 +1,19 @@
+'use strict';
+
+module.exports = () => {
+  const config = exports = {};
+
+  // add your config here
+  config.cluster = {
+    listen: {
+      port: 8101,
+    },
+  };
+
+  config.logger = {
+    // level: 'DEBUG',
+    // consoleLevel: 'DEBUG',
+  };
+
+  return config;
+};

+ 4 - 0
config/plugin.js

@@ -2,3 +2,7 @@
 
 // had enabled by egg
 // exports.static = true;
+
+exports.multiTenancy = {
+  enable: false,
+};

+ 2 - 1
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "smart-user",
+  "name": "platform-user",
   "version": "1.0.0",
   "description": "smart jobs platform user service",
   "private": true,
@@ -16,6 +16,7 @@
     "egg-mock": "^3.14.0",
     "eslint": "^4.16.0",
     "eslint-config-egg": "^6.0.0",
+    "eslint-config-egg-naf": "0.0.3",
     "webstorm-disable-index": "^1.2.0"
   },
   "engines": {