Skip to content

Commit 87f5dbd

Browse files
Update devcontainer setup
1 parent 0008ffe commit 87f5dbd

4 files changed

Lines changed: 30 additions & 22 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"dockerComposeFile": "docker-compose.yml",
44
"service": "dev",
55
"workspaceFolder": "/workspaces/simplens-core",
6+
// Stop all containers when VS Code window is closed
7+
"shutdownAction": "stopCompose",
68
// VS Code customizations
79
"customizations": {
810
"vscode": {
@@ -25,23 +27,7 @@
2527
"streetsidesoftware.code-spell-checker",
2628
"usernamehw.errorlens"
2729
],
28-
"settings": {
29-
"editor.formatOnSave": true,
30-
"editor.defaultFormatter": "esbenp.prettier-vscode",
31-
"editor.codeActionsOnSave": {
32-
"source.fixAll.eslint": "explicit"
33-
},
34-
"typescript.preferences.importModuleSpecifier": "non-relative",
35-
"typescript.tsdk": "node_modules/typescript/lib",
36-
"[typescript]": {
37-
"editor.defaultFormatter": "esbenp.prettier-vscode"
38-
},
39-
"files.watcherExclude": {
40-
"**/node_modules/**": true,
41-
"**/dist/**": true,
42-
"**/.git/**": true
43-
}
44-
}
30+
"settings": {}
4531
}
4632
},
4733
// Port forwarding - access services from your Windows browser

.vscode/settings.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.eslint": "explicit"
6+
},
7+
"typescript.preferences.importModuleSpecifier": "non-relative",
8+
"typescript.tsdk": "node_modules/typescript/lib",
9+
"[typescript]": {
10+
"editor.defaultFormatter": "esbenp.prettier-vscode"
11+
},
12+
"files.watcherExclude": {
13+
"**/node_modules/**": true,
14+
"**/dist/**": true,
15+
"**/.git/**": true
16+
}
17+
}

dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"dev": "next dev -p 3002",
7-
"build": "next build",
7+
"build": "NODE_ENV=production next build",
88
"start": "next start -p 3002",
99
"lint": "eslint"
1010
},

scripts/load-test.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@ const NS_API_KEY = process.env.NS_API_KEY || '4YCItWcuH2qJe3bXM9LbsbqefflWFlXlzv
1616

1717
const TOTAL_REQUESTS = parseInt(process.argv[2] || '1000');
1818
const CONCURRENCY = parseInt(process.argv[3] || '50');
19-
const IS_MULTIPROVIDER = ((process.argv[4]?(process.argv[4] === "-m"): false)? true: false)
2019

21-
const available_mock_providers = ["mock", "mock-new"]
20+
// Parse arguments for -h flag
21+
const args = process.argv.slice(2);
22+
const helpIndex = args.indexOf('-h');
23+
const hostType = helpIndex !== -1 && args[helpIndex + 1] ? args[helpIndex + 1] : 'local';
24+
const webhookHost = hostType === 'docker' ? 'host.docker.internal' : 'localhost';
25+
2226

2327
const createPayload = () => ({
2428
request_id: randomUUID(),
2529
client_id: "5f2c1d77-8a4b-4a5a-9b1c-2c3d4e5f6a7b",
2630
channel: ["mock"],
27-
provider: IS_MULTIPROVIDER? [available_mock_providers[randomInt(2)]]: ["mock-new"],
31+
provider: ["mock-new"],
2832
recipient: {
2933
user_id: "user_12345",
3034
},
@@ -33,7 +37,7 @@ const createPayload = () => ({
3337
message: "Thanks for signing up! Reply HELP for assistance."
3438
}
3539
},
36-
webhook_url: "http://host.docker.internal:4000/webhook",
40+
webhook_url: `http://${webhookHost}:4000/webhook`,
3741
retry_count: 3
3842
});
3943

@@ -72,6 +76,7 @@ const main = async () => {
7276
console.log(` URL: ${BASE_URL}/notification`);
7377
console.log(` Total Requests: ${TOTAL_REQUESTS}`);
7478
console.log(` Concurrency: ${CONCURRENCY}`);
79+
console.log(` Webhook Host: ${webhookHost} (-h ${hostType})`);
7580
console.log('');
7681

7782
const results = [];

0 commit comments

Comments
 (0)