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 { rateLimiter } from '../api/middlewares/index.js';
|
||||||
import bodyParser from "body-parser";
|
import bodyParser from "body-parser";
|
||||||
import session from "express-session";
|
import session from "express-session";
|
||||||
|
import cookieParser from "cookie-parser";
|
||||||
|
|
||||||
export default (app) => {
|
export default (app) => {
|
||||||
logger.info("Loading Express ...");
|
logger.info("Loading Express ...");
|
||||||
@ -31,9 +32,15 @@ export default (app) => {
|
|||||||
app.use(cors({ origin: true, credentials: true }));
|
app.use(cors({ origin: true, credentials: true }));
|
||||||
app.use(bodyParser.urlencoded({ extended: false }));
|
app.use(bodyParser.urlencoded({ extended: false }));
|
||||||
app.use(bodyParser.json());
|
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(helmet());
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
|
app.use(cookieParser());
|
||||||
app.use(express.static("public"));
|
app.use(express.static("public"));
|
||||||
app.disable("x-powered-by");
|
app.disable("x-powered-by");
|
||||||
app.disable("etag");
|
app.disable("etag");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user