[api] allow CORS
This commit is contained in:
parent
32d65b52ec
commit
cf56b87f0f
|
@ -60,6 +60,8 @@ app.use(async function (req, res, next) {
|
||||||
res.on('finish', async () => {
|
res.on('finish', async () => {
|
||||||
await req.db.close();
|
await req.db.close();
|
||||||
});
|
});
|
||||||
|
res.set('Access-Control-Allow-Origin', '*');
|
||||||
|
res.set('Access-Control-Allow-Headers', 'authorization,content-type');
|
||||||
next();
|
next();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
next(err);
|
next(err);
|
||||||
|
|
Reference in New Issue