Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const path = require('path');
const helmet = require('helmet');
const { verifyLogin } = require('./shared/jwt');
const { init, reset: resetDb } = require('./shared/db');
const { forceSsl } = require('./shared/https');
const app = express();
const PORT = process.env.PORT || 3000;
const parsePost = bodyParser.urlencoded({ extended: false });
const cspMiddleware = csp({
policies: {
'default-src': [csp.SELF],
'script-src': [csp.NONCE],
'style-src': [csp.NONCE],
'object-src': [csp.NONE],
'img-src': [csp.SELF, 'api.adorable.io', 'media.giphy.com'],
'font-src': [csp.SELF, 'fonts.gstatic.com'],
'block-all-mixed-content': true
},
reportUri: '/csp-report'
});
app.use(
express.static(path.join(__dirname, '../public'), {
index: false,
extensions: ['html']
})
);
app.use(markoExpress());
const { verifyLogin } = require('./shared/jwt');
const { init, reset: resetDb } = require('./shared/db');
const { forceSsl } = require('./shared/https');
const app = express();
const PORT = process.env.PORT || 3000;
const parsePost = bodyParser.urlencoded({ extended: false });
const cspMiddleware = csp({
policies: {
'default-src': [csp.SELF],
'script-src': [csp.NONCE],
'style-src': [csp.NONCE],
'object-src': [csp.NONE],
'img-src': [csp.SELF, 'api.adorable.io', 'media.giphy.com'],
'font-src': [csp.SELF, 'fonts.gstatic.com'],
'block-all-mixed-content': true
},
reportUri: '/csp-report'
});
app.use(
express.static(path.join(__dirname, '../public'), {
index: false,
extensions: ['html']
})
);
app.use(markoExpress());
app.use(cookieParser());
app.use(forceSsl);
const markoExpress = require('marko/express');
const path = require('path');
const helmet = require('helmet');
const { verifyLogin } = require('./shared/jwt');
const { init, reset: resetDb } = require('./shared/db');
const { forceSsl } = require('./shared/https');
const app = express();
const PORT = process.env.PORT || 3000;
const parsePost = bodyParser.urlencoded({ extended: false });
const cspMiddleware = csp({
policies: {
'default-src': [csp.SELF],
'script-src': [csp.NONCE],
'style-src': [csp.NONCE],
'object-src': [csp.NONE],
'img-src': [csp.SELF, 'api.adorable.io', 'media.giphy.com'],
'font-src': [csp.SELF, 'fonts.gstatic.com'],
'block-all-mixed-content': true
},
reportUri: '/csp-report'
});
app.use(
express.static(path.join(__dirname, '../public'), {
index: false,
extensions: ['html']
})
);