feat(mobile): ota updates added
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
vars {
|
||||
url: http://localhost:5500
|
||||
url: http://localhost:4200
|
||||
session_cookie:
|
||||
urlv2: http://localhost:3000
|
||||
jwtV2:
|
||||
|
||||
8
LogisticsSupportTool_API_DOCS/mobile/folder.bru
Normal file
8
LogisticsSupportTool_API_DOCS/mobile/folder.bru
Normal file
@@ -0,0 +1,8 @@
|
||||
meta {
|
||||
name: mobile
|
||||
seq: 4
|
||||
}
|
||||
|
||||
auth {
|
||||
mode: inherit
|
||||
}
|
||||
15
LogisticsSupportTool_API_DOCS/mobile/getsession.bru
Normal file
15
LogisticsSupportTool_API_DOCS/mobile/getsession.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: getsession
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url:
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
}
|
||||
15
LogisticsSupportTool_API_DOCS/mobile/ota system check.bru
Normal file
15
LogisticsSupportTool_API_DOCS/mobile/ota system check.bru
Normal file
@@ -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
|
||||
}
|
||||
16
app/main.ts
16
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user