mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
28 lines
681 B
JavaScript
28 lines
681 B
JavaScript
const express = require('express');
|
|
const helmet = require('helmet');
|
|
const path = require('path');
|
|
|
|
const app = express();
|
|
const PORT = process.env.PORT || 3000;
|
|
const DIST = path.join(__dirname, 'dist-obf');
|
|
// Security middleware
|
|
app.use(helmet());
|
|
app.use(helmet.contentSecurityPolicy({
|
|
directives: {
|
|
defaultSrc: ["'self'"],
|
|
scriptSrc: ["'self'"],
|
|
styleSrc: ["'self'", "'unsafe-inline'"],
|
|
imgSrc: ["'self'", 'data:'],
|
|
connectSrc: ["'self'"],
|
|
}
|
|
}));
|
|
|
|
app.use(express.static(DIST));
|
|
|
|
app.get('*', (req, res) => {
|
|
res.sendFile(path.join(DIST, 'index.html'));
|
|
});
|
|
|
|
app.listen(PORT, () => {
|
|
console.log(`Server running on http://localhost:${PORT}`);
|
|
});
|