properly load middleware
This commit is contained in:
parent
6af483ece5
commit
80c0a8be3e
|
@ -1 +1,16 @@
|
|||
module.exports = (router) => {}
|
||||
|
||||
const Redis = require("ioredis").Redis;
|
||||
/** @type {import('ioredis').Redis} */
|
||||
const redis = new Redis(process.env.REDIS_PORT, process.env.REDIS_HOST);
|
||||
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
async function session(req, res, next) {
|
||||
res.send(req.cookies);
|
||||
return;
|
||||
}
|
||||
|
||||
router.use(session);
|
||||
|
||||
module.exports = router;
|
|
@ -1,3 +1,6 @@
|
|||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
async function handler(req, res, next) {
|
||||
// TODO:
|
||||
// Log only non-automatical requests
|
||||
|
@ -11,6 +14,6 @@ async function handler(req, res, next) {
|
|||
next();
|
||||
}
|
||||
|
||||
module.exports = (router) => {
|
||||
router.use(handler);
|
||||
}
|
||||
router.use(handler);
|
||||
|
||||
module.exports = router
|
Loading…
Reference in New Issue