Skip to content

Commit 701ea38

Browse files
committed
fix: impementation hpp & request ip
1 parent beacc2d commit 701ea38

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/app.ts

+5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import createError from 'http-errors'
22
import express, { Request, Response, NextFunction } from 'express'
33
import path from 'path'
44
import cors from 'cors'
5+
import hpp from 'hpp'
56
import helmet from 'helmet'
67
import logger from 'morgan'
8+
import requestIp from 'request-ip'
79
import bodyParser from 'body-parser'
810
import cookieParser from 'cookie-parser'
911
import indexRouter from 'routes'
@@ -31,6 +33,9 @@ app.use(bodyParser.urlencoded({ extended: false }))
3133
app.use(cookieParser())
3234
app.use(express.static(path.join(`${__dirname}/../`, 'public')))
3335

36+
app.use(hpp())
37+
app.use(requestIp.mw())
38+
3439
app.use((req: Request, res, next) => {
3540
new withState(req)
3641
next()

0 commit comments

Comments
 (0)