add withMiddleware for all api routes. Now it do nothing

This commit is contained in:
tmshv committed 2019-10-12 04:58:56 +03:00
1 parent cd7536f74f
commit 95c8369df2
16 files changed
+48 -30

No files matched your search

+3 -2
View File
@@ -2,8 +2,9 @@ import { connect } from '../../src/core/db'
import Page from '../../src/core/Page'
import { getPathWithNoTrailingSlash } from '../../src/lib/url'
import { encodePage } from '../../src/api/page'
import { withMiddleware } from '../../src/middlewares/withMiddleware'
export default async (req, res) => {
export default withMiddleware(async (req, res) => {
await connect()
const page = getPathWithNoTrailingSlash(req.query.page)
@@ -17,4 +18,4 @@ export default async (req, res) => {
error: `Image ${page} not found`
})
}
}
})