api get page item changed

This commit is contained in:
tmshv committed 2020-02-15 03:46:17 +03:00
1 parent 744f127585
commit b4da11e086
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ import { getPathWithNoTrailingSlash } from '../lib/url'
import { encodePage } from '../factory/page'
export async function getItem(req: Request, res: Response) {
const id = req.params.slug
const id = req.query.page
const page = getPathWithNoTrailingSlash(id)
const resource = await Page.findByUrl(page)
+1 -1
View File
@@ -42,7 +42,7 @@ async function main() {
app.get('/pages', page.getAll)
app.get('/pages/urls', page.getUrls)
app.get('/pages/:slug', page.getItem)
app.get('/page', page.getItem)
app.get('/images/:slug', image.getItem)