mirror of
https://github.com/directus/directus.git
synced 2026-01-23 15:38:09 -05:00
fix endpoint not found
This commit is contained in:
@@ -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'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user