mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 17:03:49 +01:00
アクセスログを書き込むファイルを指定できるように
This commit is contained in:
parent
7073e6f1ae
commit
28e558808c
@ -56,6 +56,7 @@ interface ISource {
|
|||||||
siteKey: string;
|
siteKey: string;
|
||||||
secretKey: string;
|
secretKey: string;
|
||||||
};
|
};
|
||||||
|
accesslog: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,8 +19,10 @@ const app = express();
|
|||||||
app.disable('x-powered-by');
|
app.disable('x-powered-by');
|
||||||
|
|
||||||
// Log
|
// Log
|
||||||
app.use(morgan(
|
app.use(morgan(process.env.NODE_ENV == 'production' ? 'combined' : 'dev', {
|
||||||
process.env.NODE_ENV == 'production' ? 'combined' : 'dev'));
|
// create a write stream (in append mode)
|
||||||
|
stream: config.accesslog ? fs.createWriteStream(config.accesslog) : null
|
||||||
|
}));
|
||||||
|
|
||||||
// Drop request that without 'Host' header
|
// Drop request that without 'Host' header
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user