From b6030de4f44e73ce8bb9152886d384b9d7f2edff Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Mon, 10 Nov 2025 20:19:19 -0600 Subject: [PATCH] feat(mobile): ota updates added --- .../environments/lst.bru | 2 +- LogisticsSupportTool_API_DOCS/mobile/folder.bru | 8 ++++++++ .../mobile/getsession.bru | 15 +++++++++++++++ .../mobile/ota system check.bru | 15 +++++++++++++++ app/main.ts | 16 ++++++++++++++++ 5 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 LogisticsSupportTool_API_DOCS/mobile/folder.bru create mode 100644 LogisticsSupportTool_API_DOCS/mobile/getsession.bru create mode 100644 LogisticsSupportTool_API_DOCS/mobile/ota system check.bru diff --git a/LogisticsSupportTool_API_DOCS/environments/lst.bru b/LogisticsSupportTool_API_DOCS/environments/lst.bru index bd1ed2c..e1d91e8 100644 --- a/LogisticsSupportTool_API_DOCS/environments/lst.bru +++ b/LogisticsSupportTool_API_DOCS/environments/lst.bru @@ -1,5 +1,5 @@ vars { - url: http://localhost:5500 + url: http://localhost:4200 session_cookie: urlv2: http://localhost:3000 jwtV2: diff --git a/LogisticsSupportTool_API_DOCS/mobile/folder.bru b/LogisticsSupportTool_API_DOCS/mobile/folder.bru new file mode 100644 index 0000000..75b0d9f --- /dev/null +++ b/LogisticsSupportTool_API_DOCS/mobile/folder.bru @@ -0,0 +1,8 @@ +meta { + name: mobile + seq: 4 +} + +auth { + mode: inherit +} diff --git a/LogisticsSupportTool_API_DOCS/mobile/getsession.bru b/LogisticsSupportTool_API_DOCS/mobile/getsession.bru new file mode 100644 index 0000000..a53a4e0 --- /dev/null +++ b/LogisticsSupportTool_API_DOCS/mobile/getsession.bru @@ -0,0 +1,15 @@ +meta { + name: getsession + type: http + seq: 1 +} + +get { + url: + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/LogisticsSupportTool_API_DOCS/mobile/ota system check.bru b/LogisticsSupportTool_API_DOCS/mobile/ota system check.bru new file mode 100644 index 0000000..050577d --- /dev/null +++ b/LogisticsSupportTool_API_DOCS/mobile/ota system check.bru @@ -0,0 +1,15 @@ +meta { + name: ota system check + type: http + seq: 2 +} + +get { + url: {{url}}/lst/api/mobile + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/app/main.ts b/app/main.ts index 0f9eaff..6bf9c09 100644 --- a/app/main.ts +++ b/app/main.ts @@ -188,6 +188,22 @@ const main = async () => { res.sendFile(join(__dirname, "../lstDocs/build/index.html")); }); + // app ota updates + app.use( + basePath + "/api/mobile/updates", + express.static(join(__dirname, "../mobileLst/dist"), { + setHeaders(res) { + // OTA runtime needs to fetch these from the device + console.log("OTA check called"); + res.setHeader("Access-Control-Allow-Origin", "*"); + }, + }), + ); + + app.get(basePath + "/api/mobile", (_, res) => + res.status(200).json({ message: "LST OTA server is up." }), + ); + // server setup const server = createServer(app);