Ver código fonte

build update

lrf 1 ano atrás
pai
commit
b6416f3937
3 arquivos alterados com 35 adições e 9 exclusões
  1. 30 0
      src/config/config.prod.ts
  2. 1 1
      src/service/chat.service.ts
  3. 4 8
      tsconfig.json

+ 30 - 0
src/config/config.prod.ts

@@ -0,0 +1,30 @@
+import { MidwayConfig } from '@midwayjs/core';
+const ip = 'host.docker.internal';
+const project = 'follow23';
+export default {
+  mongoose: {
+    dataSource: {
+      default: {
+        uri: `mongodb://${ip}:27017/${project}`,
+        options: {
+          user: 'admin',
+          pass: 'admin',
+          authSource: 'admin',
+          useNewUrlParser: true,
+        },
+        entities: ['./entity'],
+      },
+    },
+  },
+  redis: {
+    client: {
+      port: 6379, // Redis port
+      host: ip, // Redis host
+      password: '123456',
+      db: 4,
+    },
+  },
+  rabbitmq: {
+    url: `amqp://visit:visit@${ip}/visit`,
+  },
+} as MidwayConfig;

+ 1 - 1
src/service/chat.service.ts

@@ -3,7 +3,7 @@ import { InjectEntityModel } from '@midwayjs/typegoose';
 import { ReturnModelType } from '@typegoose/typegoose';
 import { BaseService, PageOptions, SearchBase } from 'free-midway-component';
 import { Chat } from '../entity/chat.entity';
-import { cloneDeep, get, head } from 'lodash';
+import { cloneDeep } from 'lodash';
 import { ChatMqService } from './chatMq.service';
 type modelType = ReturnModelType<typeof Chat>;
 @Provide()

+ 4 - 8
tsconfig.json

@@ -6,7 +6,7 @@
     "moduleResolution": "node",
     "experimentalDecorators": true,
     "emitDecoratorMetadata": true,
-    "inlineSourceMap":true,
+    "inlineSourceMap": true,
     "noImplicitThis": true,
     "noUnusedLocals": true,
     "stripInternal": true,
@@ -14,13 +14,9 @@
     "pretty": true,
     "declaration": true,
     "forceConsistentCasingInFileNames": true,
-    "typeRoots": [ "./typings", "./node_modules/@types"],
+    "typeRoots": ["./typings", "./node_modules/@types"],
     "outDir": "dist",
-    "removeComments": true,
+    "esModuleInterop": true
   },
-  "exclude": [
-    "dist",
-    "node_modules",
-    "test"
-  ]
+  "exclude": ["dist", "node_modules", "test"]
 }