diff --git a/api/src/controllers/server.ts b/api/src/controllers/server.ts index 53d6c69aa6..b9960dfeca 100644 --- a/api/src/controllers/server.ts +++ b/api/src/controllers/server.ts @@ -1,17 +1,21 @@ import { Router } from 'express'; import { ServerService } from '../services'; -import { SpecificationService } from '../services' +import { SpecificationService } from '../services'; import asyncHandler from 'express-async-handler'; import { respond } from '../middleware/respond'; const router = Router(); -router.get('/specs/oas', asyncHandler(async (req, res, next) => { - const url = req.protocol + '://' + req.get('host') + '/' - const service = new SpecificationService(url, {accountability: req.accountability}) - res.locals.payload = await service.generateOAS(); - return next() -})); +router.get( + '/specs/oas', + asyncHandler(async (req, res, next) => { + const url = req.protocol + '://' + req.get('host') + '/'; + const service = new SpecificationService(url, { accountability: req.accountability }); + res.locals.payload = await service.generateOAS(); + return next(); + }), + respond +); router.get('/ping', (req, res) => res.send('pong'));