remove old module.exports from server aswell

This commit is contained in:
Matteo Pagliazzi
2019-10-02 19:45:27 +02:00
parent e0a2528a4f
commit 45f7cf04ab
91 changed files with 116 additions and 127 deletions

View File

@@ -1,4 +1,4 @@
module.exports = function corsMiddleware (req, res, next) {
export default function corsMiddleware (req, res, next) {
res.set({
'Access-Control-Allow-Origin': req.header('origin') || '*',
'Access-Control-Allow-Methods': 'OPTIONS,GET,POST,PUT,HEAD,DELETE',
@@ -6,4 +6,4 @@ module.exports = function corsMiddleware (req, res, next) {
});
if (req.method === 'OPTIONS') return res.sendStatus(200);
return next();
};
}