This repository was archived by the owner on Aug 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +1231
-25
lines changed Expand file tree Collapse file tree 6 files changed +1231
-25
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "debug.internalConsoleOptions" : " neverOpen"
3
- }
2
+ "debug.internalConsoleOptions" : " neverOpen" ,
3
+ "vsmqtt.brokerProfiles" : [
4
+ {
5
+ "name" : " devicescript gateway" ,
6
+ "host" : " 0.0.0.0" ,
7
+ "port" : 1883 ,
8
+ "clientId" : " vsmqtt_client"
9
+ }
10
+ ]
11
+ }
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env zx
2
- import ' zx/globals'
2
+ import " zx/globals"
3
3
import dotenv from "dotenv"
4
4
import { expand } from "dotenv-expand"
5
5
import { networkInterfaces } from "os"
@@ -49,6 +49,15 @@ else if (!azure) {
49
49
process . env . WEBSITE_HOSTNAME = `${ address } :${ port } `
50
50
}
51
51
52
+ if ( process . env . DEVS_MQTT_SERVER_DEV ) {
53
+ process . env . DEVS_MQTT_SERVER = `mqtt://${ process . env . WEBSITE_HOSTNAME } :1883`
54
+ $ `yarn mqtt`
55
+ console . log ( `started development MQTT server` )
56
+ console . warn (
57
+ `- make sure to change the visibility of port '1883', '3000' to 'Public'`
58
+ )
59
+ }
60
+
52
61
expand ( out )
53
62
54
63
if ( ! azure ) {
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ DEVS_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=http;AccountName=devsto
6
6
DEVS_PASSWORDS_SECRET = " DEVS_LOCAL_USER_PASSWORD"
7
7
DEVS_LOCAL_USER_PASSWORD = " devstoreaccount1:Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
8
8
DEVS_CONNECTION_STRING = " AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;ApiRoot=$WEBSITE_PROTOCOL ://$WEBSITE_HOSTNAME "
9
- DEVS_MQTT_SERVER = " mqtt://public.mqtthq.com:1883 "
9
+ DEVS_MQTT_SERVER_DEV = " 1 "
Original file line number Diff line number Diff line change 22
22
"dev" : " yarn build && zx dev.mjs --local" ,
23
23
"dev:azure" : " yarn build && zx dev.mjs --azure" ,
24
24
"logs" : " node infra/logs.mjs" ,
25
- "deploy" : " node infra/zipdeploy.mjs"
25
+ "deploy" : " node infra/zipdeploy.mjs" ,
26
+ "mqtt" : " yarn aedes start --protos tcp ws --host 0.0.0.0 --broker-id devicescript-gateway --verbose"
26
27
},
27
28
"dependencies" : {
28
29
"@azure/data-tables" : " ^13.2.0" ,
36
37
"@fastify/static" : " ^6.5.0" ,
37
38
"@fastify/websocket" : " ^7.1.0" ,
38
39
"aedes" : " ^0.48.0" ,
40
+ "aedes-cli" : " ^0.6.1" ,
39
41
"applicationinsights" : " ^2.5.0" ,
40
42
"dotenv-expand" : " ^10.0.0" ,
41
43
"fastify" : " ^4.9.2" ,
Original file line number Diff line number Diff line change @@ -150,8 +150,13 @@ async function main() {
150
150
<body>
151
151
<h1>Development DeviceScript Gateway</h1>
152
152
<ul>
153
- <li>Open <a href='./swagger/'>OpenAPI dashboard (swagger)</a>.</li>
153
+ <li><a href='./swagger/'>OpenAPI dashboard (swagger)</a>.</li>
154
154
<li><a href='https://microsoft.github.io/devicescript/developer/cloud/gateway'>Documentation</a></li>
155
+ ${
156
+ process . env . DEVS_MQTT_SERVER
157
+ ? `<li>MQTT server: ${ process . env . DEVS_MQTT_SERVER } </li>`
158
+ : ""
159
+ }
155
160
</ul>
156
161
</body>
157
162
</html>`
You can’t perform that action at this time.
0 commit comments