Now logging visits to shorturls
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user