Added cookie handling and morgan logging updates
This commit is contained in:
parent
a114b1aaaf
commit
9bbb23de48
@ -9,6 +9,7 @@ import { logger } from "../utils/index.js";
|
||||
// import { rateLimiter } from '../api/middlewares/index.js';
|
||||
import bodyParser from "body-parser";
|
||||
import session from "express-session";
|
||||
import cookieParser from "cookie-parser";
|
||||
|
||||
export default (app) => {
|
||||
logger.info("Loading Express ...");
|
||||
@ -31,9 +32,15 @@ export default (app) => {
|
||||
app.use(cors({ origin: true, credentials: true }));
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
app.use(bodyParser.json());
|
||||
app.use(morgan("dev"));
|
||||
// app.use(morgan("dev"));
|
||||
app.use(morgan("common", {
|
||||
stream: {
|
||||
write: (message) => logger.info(message.trim()),
|
||||
},
|
||||
}));
|
||||
app.use(helmet());
|
||||
app.use(compression());
|
||||
app.use(cookieParser());
|
||||
app.use(express.static("public"));
|
||||
app.disable("x-powered-by");
|
||||
app.disable("etag");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user