const express = require('express'); const app = express(); /* set CSP header */ app.use((req, res, next) => { /* allow local and CDN scripts */ res.setHeader('Content-Security-Policy', "script-src 'self' https://cdn.sheetjs.com data: blob:;"); /* if this is used, loading from the SheetJS CDN will fail */ //res.setHeader('Content-Security-Policy', "script-src 'self' data: blob:;"); /* if this is used, loading local scripts will fail */ //res.setHeader('Content-Security-Policy', "script-src https://cdn.sheetjs.com data: blob:;"); next(); }); /* serve folder */ app.use(express.static(__dirname)); /* start server */ app.listen(7262, () => { console.log(`Listening on port 7262`); });