Now logging visits to shorturls

This commit is contained in:
2021-08-14 09:23:55 +02:00
parent 5e9dec640a
commit c4c22a7405
2 changed files with 3 additions and 2 deletions

View File

@@ -55,7 +55,8 @@ fastify.get('/:shortcode', async (req, res) => {
if (!target[0]) {
return 404
}
res.redirect(302, target[0].target)
res.redirect(302, target[0].target);
await knex('visits').insert({ shortcode });
})
//Create new url schema