29c84cf8b9
commit c0148e8301b9d2a987c79d8f49f90e678c75e5a4 Author: Roberto Tonino <roberto.tonino5@gmail.com> Date: Fri Apr 9 21:06:02 2021 +0200 test: disabled logger when in test mode; refactor: type names commit 418fc5647f2adb97df312eed5eb9c2d17de9d24c Author: Roberto Tonino <roberto.tonino5@gmail.com> Date: Fri Apr 9 20:49:54 2021 +0200 test: added albumSearch test; chore: removed sample endpoint commit e2c79f6ee65448b92714bffd5281072279e0b522 Author: Roberto Tonino <roberto.tonino5@gmail.com> Date: Fri Apr 9 19:16:25 2021 +0200 test: added cookie parser test commit 78d70b7369015cd467f684e636c6788b58c54a7a Author: Roberto Tonino <roberto.tonino5@gmail.com> Date: Fri Apr 9 19:07:44 2021 +0200 feat: added root path first test commit eb91ff06d62d81fbfa6851f1dea374addf709582 Author: Roberto Tonino <roberto.tonino5@gmail.com> Date: Fri Apr 9 18:45:32 2021 +0200 feat: added test deps
17 lines
450 B
TypeScript
17 lines
450 B
TypeScript
import type { Application } from 'express'
|
|
import logger from 'morgan'
|
|
import express from 'express'
|
|
import cookieParser from 'cookie-parser'
|
|
import { WEBUI_DIR } from './helpers/paths'
|
|
|
|
export function registerMiddlewares(app: Application) {
|
|
if (process.env.NODE_ENV !== 'test') {
|
|
app.use(logger('dev'))
|
|
}
|
|
|
|
app.use(express.json())
|
|
app.use(express.urlencoded({ extended: false }))
|
|
app.use(cookieParser())
|
|
app.use(express.static(WEBUI_DIR))
|
|
}
|