@@ -3,7 +3,7 @@
const Service = require('egg').Service;
const assert = require('assert');
const moment = require('moment');
-class ContentService extends Service {
+class BannerService extends Service {
async create({ title, path, annex, content, annexname, date }) {
assert(title, '标题不存在');
assert(path, '轮播图不存在');
@@ -73,4 +73,4 @@ class ContentService extends Service {
}
-module.exports = ContentService;
+module.exports = BannerService;
@@ -0,0 +1,7 @@
+const egg = require('egg');
+
+const workers = Number(process.argv[2] || require('os').cpus().length);
+egg.startCluster({
+ workers,
+ baseDir: __dirname,
+});