Formatting
This commit is contained in:
parent
4d4d649458
commit
83769bb816
@ -1,7 +1,9 @@
|
|||||||
import { logger } from "../../utils/index.js";
|
import { logger } from "../../utils/index.js";
|
||||||
|
|
||||||
export default (req, res, next) => {
|
export default (req, res, next) => {
|
||||||
logger.debug(`URI: ${req.method} ${req.protocol}://${req.hostname}:${req.client.localPort}${req.originalUrl}`);
|
logger.debug(
|
||||||
|
`URI: ${req.method} ${req.protocol}://${req.hostname}:${req.client.localPort}${req.originalUrl}`
|
||||||
|
);
|
||||||
logger.debug(`Headers: ${JSON.stringify(req.headers, null, 2)}`);
|
logger.debug(`Headers: ${JSON.stringify(req.headers, null, 2)}`);
|
||||||
logger.debug(`Cookies: ${JSON.stringify(req.cookies, null, 2)}`);
|
logger.debug(`Cookies: ${JSON.stringify(req.cookies, null, 2)}`);
|
||||||
logger.debug(`Query: ${JSON.stringify(req.query, null, 2)}`);
|
logger.debug(`Query: ${JSON.stringify(req.query, null, 2)}`);
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import localStorage from "local-storage";
|
|||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.all("/", (req, res, next) => {
|
router.all("/", (req, res, next) => {
|
||||||
|
|
||||||
var token = null;
|
var token = null;
|
||||||
var sessionIdentifier = null;
|
var sessionIdentifier = null;
|
||||||
const cookiePrefix = "__Host-VRNTOTCT";
|
const cookiePrefix = "__Host-VRNTOTCT";
|
||||||
|
|||||||
@ -9,7 +9,7 @@ loader(app);
|
|||||||
|
|
||||||
app.listen(config.port, (err) => {
|
app.listen(config.port, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
logger.info(err)
|
logger.info(err);
|
||||||
return process.exit(1);
|
return process.exit(1);
|
||||||
}
|
}
|
||||||
logger.info(`Server is running on ${config.port}`);
|
logger.info(`Server is running on ${config.port}`);
|
||||||
|
|||||||
@ -33,11 +33,13 @@ export default (app) => {
|
|||||||
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", {
|
app.use(
|
||||||
stream: {
|
morgan("common", {
|
||||||
write: (message) => logger.info(message.trim()),
|
stream: {
|
||||||
},
|
write: (message) => logger.info(message.trim()),
|
||||||
}));
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
app.use(helmet());
|
app.use(helmet());
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user