0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Fixed order of routes

This commit is contained in:
Fabien "egg" O'Carroll 2023-11-15 14:30:11 +07:00
parent 671346dc15
commit 529990cadf

View file

@ -31,6 +31,9 @@ module.exports = function setupApiApp() {
// Admin API shouldn't be cached
apiApp.use(shared.middleware.cacheControl('private'));
// Routing
apiApp.use(routes());
const nestAppPromise = GhostNestApp.create().then(async (app) => {
await app.init();
return app;
@ -41,9 +44,6 @@ module.exports = function setupApiApp() {
app.getHttpAdapter().getInstance()(req, res, next);
});
// Routing
apiApp.use(routes());
// API error handling
apiApp.use(errorHandler.resourceNotFound);
apiApp.use(APIVersionCompatibilityService.errorHandler);