initial project

This commit is contained in:
Ahmad Ardiansyah
2025-09-28 09:50:05 +07:00
commit 09f4d5ee46
5 changed files with 1151 additions and 0 deletions

18
logger/winston.js Normal file
View File

@@ -0,0 +1,18 @@
const winston = require('winston');
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
defaultMeta: { service: 'express-gitea' },
transports: [
new winston.transports.Console(),
],
});
const winstonLogger = (req, res, next) => {
logger.info(`${req.method} ${req.url}`);
next();
}
module.exports.winstonLogger = () => winstonLogger;
module.exports.logger = logger;