feat(mobile): ota updates added

This commit is contained in:
2025-11-10 20:19:19 -06:00
parent 1084cede04
commit b6030de4f4
5 changed files with 55 additions and 1 deletions

View File

@@ -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);