Skip to content

Commit

Permalink
Merge pull request #105 from torusresearch/feat/load-balancing
Browse files Browse the repository at this point in the history
update deps + allow load balancer config
  • Loading branch information
chaitanyapotti authored Nov 6, 2024
2 parents d014b61 + 912c50f commit 101de4a
Show file tree
Hide file tree
Showing 10 changed files with 12,070 additions and 13,202 deletions.
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": ["../../test/setup.mjs"],
"import": "tsx",
"timeout": 0,
"exit": true,
"extension": "ts"
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

services:
fnd-server:
restart: always
Expand Down
25,169 changes: 12,026 additions & 13,143 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
"@babel/runtime": "^7.x"
},
"devDependencies": {
"@babel/register": "^7.24.6",
"@toruslabs/config": "^2.1.0",
"@toruslabs/eslint-config-typescript": "^3.3.1",
"@toruslabs/torus-scripts": "^6.0.1",
"@types/mocha": "^10.0.6",
"@babel/register": "^7.25.9",
"@toruslabs/config": "^2.2.0",
"@toruslabs/eslint-config-typescript": "^3.3.4",
"@toruslabs/torus-scripts": "^6.1.5",
"@types/mocha": "^10.0.9",
"cross-env": "^7.0.3",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"husky": "^9.0.11",
"lerna": "^8.1.3",
"lint-staged": "^15.2.7",
"mocha": "^10.4.0",
"prettier": "^3.3.2",
"ts-node": "^10.9.2",
"husky": "^9.1.6",
"lerna": "^8.1.9",
"lint-staged": "^15.2.10",
"mocha": "^10.8.2",
"prettier": "^3.3.3",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.4.5",
"tsx": "^4.19.2",
"typescript": "^5.6.3",
"wait-port": "^1.1.0"
},
"version": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/fetch-node-details/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@toruslabs/constants": "^14.0.0",
"@toruslabs/fnd-base": "^14.0.0",
"@toruslabs/http-helpers": "^7.0.0",
"loglevel": "^1.9.1"
"loglevel": "^1.9.2"
},
"lint-staged": {
"!(*d).{js,ts}": [
Expand Down
12 changes: 0 additions & 12 deletions packages/fnd-server/nodemon.json

This file was deleted.

14 changes: 7 additions & 7 deletions packages/fnd-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"main": "src/index.ts",
"scripts": {
"serve": "nodemon --config nodemon.json",
"serve": "tsx --watch src/index.ts",
"prod": "node dist/index.js",
"clean": "rimraf ./dist",
"build": "npm run clean && npm run build:server",
Expand All @@ -16,29 +16,29 @@
"down": "docker compose -f ../../docker-compose.dev.yml down"
},
"dependencies": {
"@sentry/node": "^8.26.0",
"@sentry/node": "^8.37.1",
"@toruslabs/config": "^2.2.0",
"@toruslabs/constants": "^14.0.0",
"@toruslabs/fnd-base": "^14.0.0",
"@toruslabs/loglevel-sentry": "^7.0.1",
"celebrate": "^15.0.3",
"compression": "^1.7.4",
"compression": "^1.7.5",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"express": "^4.21.1",
"helmet": "^7.1.0",
"loglevel": "^1.9.1",
"loglevel": "^1.9.2",
"morgan": "^1.10.0"
},
"devDependencies": {
"@toruslabs/eslint-config-node": "^3.3.3",
"@toruslabs/eslint-config-node": "^3.3.4",
"@types/compression": "^1.7.5",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/morgan": "^1.9.9",
"assert": "^2.1.0",
"cross-env": "^7.0.3",
"nodemon": "^3.1.4",
"tsx": "^4.19.2",
"rimraf": "^6.0.1",
"wait-port": "^1.1.0"
},
Expand Down
26 changes: 23 additions & 3 deletions packages/fnd-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,28 @@ const corsOptions = {
// origin: ["https://localhost:3000", /\.tor\.us$/],
origin: true,
credentials: true,
allowedHeaders: ["Content-Type", "x-api-key", "x-embed-host", "sentry-trace", "baggage", "x-web3-correlation-id"],
methods: "GET",
allowedHeaders: [
"Content-Type",
"x-api-key",
"x-embed-host",
"sentry-trace",
"baggage",
"x-web3-correlation-id",
"pubkeyx",
"pubkeyy",
"verifier",
"verifier_id",
"verifierId",
"clientId",
"network",
"enable_gating",
"enableGating",
"authorization",
"wallet_provider",
"web3auth_network",
"client_id",
],
methods: "GET,PUT,PATCH,POST,DELETE",
maxAge: 86400,
};

Expand All @@ -55,7 +75,7 @@ app.disable("x-powered-by");

app.use(traceContextMiddleware);

app.use("/", router);
app.use(["/fnd-service", "/"], router);

// Add this after all routes,
// but before any and other error-handling middlewares are defined
Expand Down
3 changes: 0 additions & 3 deletions packages/fnd-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@
"module": "Node16",
"target": "ES2022",
"lib": ["ES2022"]
},
"ts-node": {
"files": true
}
}
18 changes: 0 additions & 18 deletions test/setup.mjs

This file was deleted.

0 comments on commit 101de4a

Please sign in to comment.