@rpcbase/server 0.179.0 → 0.181.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/express/index.js CHANGED
@@ -17,6 +17,11 @@ const log = debug("rb:server")
17
17
  const is_production = process.env.IS_PRODUCTION === "yes"
18
18
  const {APP_DOMAIN, CLIENT_PORT} = process.env
19
19
 
20
+ // TODO: document this
21
+ // we could have a larger size, but it's good practice to keep it small to prevent body upload ddos attacks
22
+ const BODY_MAX_SIZE_MB = 8
23
+
24
+
20
25
  log("server is production:", JSON.stringify(is_production))
21
26
 
22
27
  module.exports = () => {
@@ -24,7 +29,7 @@ module.exports = () => {
24
29
 
25
30
  app.use(request_ip.mw())
26
31
 
27
- app.use(body_parser.json({limit: "2mb"}))
32
+ app.use(body_parser.json({limit: `${BODY_MAX_SIZE_MB}mb`}))
28
33
 
29
34
  app.set("trust proxy", 1)
30
35
 
@@ -81,8 +86,8 @@ module.exports = () => {
81
86
 
82
87
  app.use(session_middleware)
83
88
 
84
- app.get("/api/ping", (req, res) => res.json({message: "pong"}))
85
- app.post("/api/ping", (req, res) => res.json({message: "pong"}))
89
+ app.get("__/ping", (req, res) => res.json({message: "pong"}))
90
+ app.post("__/ping", (req, res) => res.json({message: "pong"}))
86
91
 
87
92
  auth(app)
88
93
 
@@ -501,7 +501,7 @@ rdb-del-sync-files no
501
501
  # The Append Only File will also be created inside this directory.
502
502
  #
503
503
  # Note that you must specify a directory here, not a file name.
504
- dir ./
504
+ #dir ./
505
505
 
506
506
  ################################# REPLICATION #################################
507
507
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/server",
3
- "version": "0.179.0",
3
+ "version": "0.181.0",
4
4
  "license": "SSPL-1.0",
5
5
  "main": "./index.js",
6
6
  "bin": {