hassio-nextcloud-backup/nextcloud_backup/backend/src/routes/homeAssistant.ts

17 lines
414 B
TypeScript
Raw Normal View History

2022-09-27 23:38:40 +02:00
import express from "express";
import * as haOsService from "../services/homeAssistantService.js"
2022-09-29 00:05:53 +02:00
const homeAssistantRouter = express.Router();
2022-09-27 23:38:40 +02:00
2022-09-29 00:05:53 +02:00
homeAssistantRouter.get("/backups/", (req, res, next) => {
2022-09-27 23:38:40 +02:00
haOsService.getBackups()
.then((value)=>{
res.json(value.body.data.backups);
}).catch((reason)=>{
res.status(500);
res.json(reason);
})
});
2022-09-29 00:05:53 +02:00
export default homeAssistantRouter;