@rpcbase/server 0.80.0 → 0.81.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/cli/run_native.js CHANGED
@@ -40,7 +40,7 @@ const init_processes = (args) => {
40
40
  const worker_queue_dir = path.join(process.cwd(), "../infrastructure/data/worker-queue/data")
41
41
  const worker_queue_logs_path = path.join(process.cwd(), "../infrastructure/data/worker-queue/log/logs.txt")
42
42
 
43
- console.log("WORKER QUEUE ON PORT", env.WORKER_QUEUE_PORT)
43
+ // console.log("WORKER QUEUE ON PORT", env.WORKER_QUEUE_PORT)
44
44
 
45
45
  // TODO: add a redis cache
46
46
  const processes = [
package/database.js CHANGED
@@ -17,6 +17,8 @@ const hostname = CONTAINER_MODE === "native" ? "localhost" : "database"
17
17
  const mongo_url = `mongodb://${hostname}:${DATABASE_PORT}/${DATABASE_NAME}?directConnection=true&replicaSet=rs0`
18
18
 
19
19
 
20
+ // TODO: handle multiple databases, remove DATABASE_NAME env
21
+
20
22
  module.exports = async() => {
21
23
  // set listeners before attempting to connect
22
24
  mongoose.connection.on("connected", () => {
package/express/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  const cors = require("cors")
3
3
  const express = require("express")
4
4
  const body_parser = require("body-parser")
5
+ const request_ip = require("request-ip")
5
6
 
6
7
  // functionality middlewares
7
8
  const auth = require("../src/auth")
@@ -16,6 +17,9 @@ const {APP_DOMAIN, CLIENT_PORT} = process.env
16
17
 
17
18
  module.exports = () => {
18
19
  const app = express()
20
+
21
+ app.use(request_ip.mw())
22
+
19
23
  app.use(body_parser.json({limit: "2mb"}))
20
24
 
21
25
  app.set("trust proxy", 1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/server",
3
- "version": "0.80.0",
3
+ "version": "0.81.0",
4
4
  "license": "SSPL-1.0",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -26,6 +26,7 @@
26
26
  "picocolors": "1.0.0",
27
27
  "postmark": "3.0.12",
28
28
  "redis": "4.2.0",
29
+ "request-ip": "3.3.0",
29
30
  "validator": "13.7.0",
30
31
  "yargs": "17.5.1"
31
32
  }