import config from '../base/config.mjs' import Parent from '../base/server.mjs' import StaticRoutes from '../base/static_routes.mjs' import ServeHandler from './serve.mjs' import AuthenticationRoutes from '../base/authentication/routes.mjs' import ArticleRoutes from './article/routes.mjs' export default class Server extends Parent { init() { super.init() let localUtil = new this.core.sc.Util(import.meta.url) this.flaskaOptions.appendHeaders['Content-Security-Policy'] = `default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data: blob:; font-src 'self' data:; object-src 'none'; frame-ancestors 'none'; connect-src 'self' https://media.nfp.is/; media-src 'self' https://cdn.nfp.is/`, this.flaskaOptions.nonce = [] this.routes = { static: new StaticRoutes(), auth: new AuthenticationRoutes(), article: new ArticleRoutes(), } this.routes.serve = new ServeHandler({ root: localUtil.getPathFromRoot('../public'), version: this.core.app.running, frontend: config.get('frontend:url'), }) } }