添加导出所有数据的API接口

This commit is contained in:
Peng-YM 2020-10-03 21:06:03 +08:00
parent 317e3fc724
commit 4448fc74c3
2 changed files with 9 additions and 1 deletions

View File

@ -89,6 +89,9 @@ $app.route("/api/settings")
// backup
$app.get("/api/backup", gistBackup);
// data
$app.get("/api/export", exportData);
$app.all("/", async (req, res) => {
res.send("Hello from Sub-Store! Made with ❤️ by Peng-YM.");
});
@ -175,6 +178,11 @@ async function updateSettings(req, res) {
});
}
// export data
async function exportData(req, res) {
res.json($.read("#sub-store"));
}
/**************************** API -- Subscriptions ***************************************/
// refresh resource
async function refreshResource(req, res) {

File diff suppressed because one or more lines are too long