Route posts without interesting queries to posts

This commit is contained in:
Raymonzut
2020-05-15 13:11:15 +02:00
parent eec3738464
commit 9fdbd1b6a1
+3
View File
@@ -37,7 +37,10 @@ routes.set('', async (req, res) => {
if (req.query.sort === '1') res.send(posts_sorted) if (req.query.sort === '1') res.send(posts_sorted)
else res.send(posts_sorted.reverse()) else res.send(posts_sorted.reverse())
return
} }
// Default response when there are no interesting queries
res.send(posts)
}) })
routes.set('/:id', async (req, res) => { routes.set('/:id', async (req, res) => {