diff --git a/api/generate/openapi.json b/api/generate/openapi.json index 603fe0af6..0e0675d19 100644 --- a/api/generate/openapi.json +++ b/api/generate/openapi.json @@ -1,7 +1,7 @@ { "info": { - "title": "Mr.C API", - "version": "1.0.0" + "title": "mrc-api", + "version": "0.0.1" }, "openapi": "3.0.3", "paths": { diff --git a/api/src/controller/http/dev/dev.v1.controller.ts b/api/src/controller/http/dev/dev.v1.controller.ts index 38f7f0cd8..4e308b1f9 100644 --- a/api/src/controller/http/dev/dev.v1.controller.ts +++ b/api/src/controller/http/dev/dev.v1.controller.ts @@ -14,7 +14,6 @@ export class DevV1Controller { const prefix = '/v1/dev'; router - .use(express.json()) .route(`${prefix}/greeting`) .post(this.greeting) .all(methodNotAllowed); diff --git a/api/src/controller/http/server.ts b/api/src/controller/http/server.ts index d48791939..446b3d787 100644 --- a/api/src/controller/http/server.ts +++ b/api/src/controller/http/server.ts @@ -8,6 +8,7 @@ import { Tspec, TspecDocsMiddleware } from 'tspec'; import { Logger } from 'winston'; import apiSpecification from '@root/generate/openapi.json'; +import { name, version } from '@root/package.json'; import { DevV1Controller } from '@controller/http/dev/dev.v1.controller'; import { HealthController } from '@controller/http/health/health.controller'; @@ -30,6 +31,7 @@ export class HttpServer { this.app = express(); this.app.disable('x-powered-by'); this.app.set('trust proxy', 0); + this.app.use(express.json()); await this.buildApiDocument(); this.app.use('/api', this.middleware.accessLog); this.app.use( @@ -80,8 +82,8 @@ export class HttpServer { outputPath: './generate/openapi.json', specVersion: 3, openapi: { - title: 'Mr.C API', - version: '1.0.0', + title: name, + version: version, securityDefinitions: { jwt: { type: 'http',