mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-03 18:53:59 +08:00
feat: 日志增加 body JSON limit
This commit is contained in:
parent
fa7df51f8c
commit
f94cf7185a
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.19.43",
|
||||
"version": "2.19.44",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
6
backend/src/vendor/express.js
vendored
6
backend/src/vendor/express.js
vendored
@ -17,10 +17,12 @@ export default function express({ substore: $, port, host }) {
|
||||
const express_ = eval(`require("express")`);
|
||||
const bodyParser = eval(`require("body-parser")`);
|
||||
const app = express_();
|
||||
const limit = eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb';
|
||||
$.info(`[BACKEND] body JSON limit: ${limit}`);
|
||||
app.use(
|
||||
bodyParser.json({
|
||||
verify: rawBodySaver,
|
||||
limit: eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb',
|
||||
limit,
|
||||
}),
|
||||
);
|
||||
app.use(
|
||||
@ -36,7 +38,7 @@ export default function express({ substore: $, port, host }) {
|
||||
app.start = () => {
|
||||
const listener = app.listen(port, host, () => {
|
||||
const { address, port } = listener.address();
|
||||
$.info(`[BACKEND] ${address}:${port}`);
|
||||
$.info(`[BACKEND] listening on ${address}:${port}`);
|
||||
});
|
||||
};
|
||||
return app;
|
||||
|
Loading…
x
Reference in New Issue
Block a user