All files / src app.ts

89.47% Statements 17/19
100% Branches 0/0
0% Functions 0/2
100% Lines 16/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 223x 3x 3x 3x   3x 3x   3x   3x 3x 3x 3x   3x 9x 3x 3x   3x  
import express from 'express'
import 'express-async-errors'
import { json } from 'body-parser'
import cookieSession from 'cookie-session'
 
import { currentUser, errorHandler, NotFoundError } from '@next-k8s/common'
import routes from './routes'
 
const app = express()
 
app.disable('x-powered-by')
app.set('trust proxy', true)
app.use(json())
app.use(cookieSession({ signed: false, secure: process.env.NODE_ENV !== 'test' }))
 
app.use(currentUser)
for (const route of routes) app.use(route)
app.use('*', async (req, res) => { throw new NotFoundError() })
app.use(errorHandler)
 
export default app