This repository was archived by the owner on Aug 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
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 11#!/usr/bin/env zx
2- import ' zx/globals'
2+ import " zx/globals"
33import dotenv from "dotenv"
44import { expand } from "dotenv-expand"
55import { networkInterfaces } from "os"
@@ -49,6 +49,15 @@ else if (!azure) {
4949 process . env . WEBSITE_HOSTNAME = `${ address } :${ port } `
5050}
5151
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+
5261expand ( out )
5362
5463if ( ! azure ) {
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ DEVS_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=http;AccountName=devsto
66DEVS_PASSWORDS_SECRET = " DEVS_LOCAL_USER_PASSWORD"
77DEVS_LOCAL_USER_PASSWORD = " devstoreaccount1:Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
88DEVS_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 2222 "dev" : " yarn build && zx dev.mjs --local" ,
2323 "dev:azure" : " yarn build && zx dev.mjs --azure" ,
2424 "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"
2627 },
2728 "dependencies" : {
2829 "@azure/data-tables" : " ^13.2.0" ,
3637 "@fastify/static" : " ^6.5.0" ,
3738 "@fastify/websocket" : " ^7.1.0" ,
3839 "aedes" : " ^0.48.0" ,
40+ "aedes-cli" : " ^0.6.1" ,
3941 "applicationinsights" : " ^2.5.0" ,
4042 "dotenv-expand" : " ^10.0.0" ,
4143 "fastify" : " ^4.9.2" ,
Original file line number Diff line number Diff line change @@ -150,8 +150,13 @@ async function main() {
150150 <body>
151151 <h1>Development DeviceScript Gateway</h1>
152152 <ul>
153- <li>Open <a href='./swagger/'>OpenAPI dashboard (swagger)</a>.</li>
153+ <li><a href='./swagger/'>OpenAPI dashboard (swagger)</a>.</li>
154154 <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+ }
155160 </ul>
156161 </body>
157162 </html>`
You can’t perform that action at this time.
0 commit comments