Added cors

This commit is contained in:
2021-08-14 14:19:08 +02:00
parent 86985ef735
commit 518aa3eb08
3 changed files with 19 additions and 0 deletions

View File

@@ -21,6 +21,11 @@ const knex = require('knex')(knexConfiguration);
const authenticate = { realm: 'Short' }
fastify.register(require('fastify-basic-auth'), { validate, authenticate });
fastify.register(require('fastify-cors'), {
origin: true,
preflight: true,
preflightContinue: true
})
//Automagic Amazn redirects on /a/
fastify.get('/a/:id', async (req, res) => {