diff --git a/packages/cc-server-core/src/function/handle.ts b/packages/cc-server-core/src/function/handle.ts index 710b08f..3c43638 100644 --- a/packages/cc-server-core/src/function/handle.ts +++ b/packages/cc-server-core/src/function/handle.ts @@ -1,12 +1,12 @@ import { - controller, response, requestBody, httpGet, httpPost, queryParam + controller, response, requestBody, httpGet, httpPost, queryParam, requestParam } from 'inversify-express-utils'; import { inject } from 'inversify'; import { DBClient } from 'cc-server-db' import 'cc-server-db-mongo' //process.env.FAAS_MONGO_URL = 'mongodb://192.168.0.2:27017'; -process.env.FAAS_MONGO_DB = "faas"; +//process.env.FAAS_MONGO_DB = "faas"; const TABLE = 'users' @@ -32,7 +32,7 @@ export class Controller { @httpGet('/:id') public async get( - @queryParam('id') id: string + @requestParam('id') id: string ): Promise { return this.client.findOneById(TABLE, id); } @@ -46,7 +46,7 @@ export class Controller { @httpPost('/:id') public async update( - @queryParam('id') id: string, + @requestParam('id') id: string, @requestBody() model: Model ): Promise { return this.client.updateById(TABLE, id, model); diff --git a/packages/cc-server-db-mongo/src/client/connection.ts b/packages/cc-server-db-mongo/src/client/connection.ts index 3958b2f..d029a07 100644 --- a/packages/cc-server-db-mongo/src/client/connection.ts +++ b/packages/cc-server-db-mongo/src/client/connection.ts @@ -1,7 +1,7 @@ import { Db, MongoClient } from 'mongodb'; const connStr = process.env.FAAS_MONGO_URL || 'mongodb://192.168.0.2:27017'; -const dbName = process.env.FAAS_MONGO_DB || "frppool"; +const dbName = process.env.FAAS_MONGO_DB || "faas"; export class MongoDBConnection { private static isConnected: boolean = false;