2022-08-02 09:34:02 +00:00
|
|
|
import config from '../base/config.mjs'
|
|
|
|
import Parent from '../base/server.mjs'
|
|
|
|
import ServeHandler from '../base/serve.mjs'
|
|
|
|
import PageRoutes from '../base/page/routes.mjs'
|
|
|
|
|
|
|
|
export default class Server extends Parent {
|
2022-08-05 14:26:29 +00:00
|
|
|
init() {
|
|
|
|
this.flaskaOptions.appendHeaders['Content-Security-Policy'] = `default-src 'self'; script-src 'self' talk.hyvor.com; style-src 'self' 'unsafe-inline'; img-src * data: blob:; font-src 'self' data:; object-src 'none'; iframe-src talk.hyvor.com` //; frame-ancestors 'none'`
|
|
|
|
}
|
|
|
|
|
2022-08-02 09:34:02 +00:00
|
|
|
addCustomRoutes() {
|
|
|
|
let page = this.getRouteInstance(PageRoutes)
|
|
|
|
|
|
|
|
let localUtil = new this.core.sc.Util(import.meta.url)
|
|
|
|
this.routes.push(new ServeHandler({
|
|
|
|
pageRoutes: page,
|
|
|
|
root: localUtil.getPathFromRoot('../public'),
|
|
|
|
version: this.core.app.running,
|
|
|
|
frontend: config.get('frontend:url'),
|
|
|
|
}))
|
|
|
|
}
|
|
|
|
}
|