Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
chrypnotoad committed Aug 1, 2024
1 parent de7827e commit ed88575
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/routes/healthCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export const healthCheckRouter: Router = express.Router()

healthCheckRouter.get('/is-alive', (req: Request, res: Response) => {
nestedCountersInstance.countEvent('api', 'is-alive')
return res.status(200);
return res.status(200)
})

healthCheckRouter.get('/is-healthy', (req: Request, res: Response) => {
// TODO: Add actual health check logic
nestedCountersInstance.countEvent('api', 'health-check')
return res.status(200);
})
return res.status(200)
})
17 changes: 10 additions & 7 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,16 @@ app.set('trust proxy', true)
app.use(cors({ methods: ['POST'] }))
app.use(express.json())
app.use(cookieParser())
app.use(function(req, res, next) {
res.setHeader('X-Content-Type-Options', 'nosniff');
res.setHeader('Permissions-Policy', 'accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), navigation-override=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), web-share=(), xr-spatial-tracking=(), clipboard-read=(), clipboard-write=(), gamepad=(), speaker-selection=(), conversion-measurement=(), focus-without-user-activation=(), hid=(), idle-detection=(), interest-cohort=(), serial=(), sync-script=(), trust-token-redemption=(), unload=(), window-placement=(), vertical-scroll=()');
res.setHeader('X-Frame-Options', 'SAMEORIGIN');
res.setHeader('Content-Security-Policy', "default-src 'self'");
next();
});
app.use(function (req, res, next) {
res.setHeader('X-Content-Type-Options', 'nosniff')
res.setHeader(
'Permissions-Policy',
'accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), navigation-override=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), web-share=(), xr-spatial-tracking=(), clipboard-read=(), clipboard-write=(), gamepad=(), speaker-selection=(), conversion-measurement=(), focus-without-user-activation=(), hid=(), idle-detection=(), interest-cohort=(), serial=(), sync-script=(), trust-token-redemption=(), unload=(), window-placement=(), vertical-scroll=()'
)
res.setHeader('X-Frame-Options', 'SAMEORIGIN')
res.setHeader('Content-Security-Policy', "default-src 'self'")
next()
})

if (config.dashboard.enabled && config.dashboard.dist_path) {
const clientDirectory =
Expand Down

0 comments on commit ed88575

Please sign in to comment.