mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-09-12 18:03:16 +08:00
Reintroduce storage management API, closes #113
This commit is contained in:
parent
56ada242d2
commit
f91f34d644
2
backend/dist/sub-store-parser.loon.min.js
vendored
2
backend/dist/sub-store-parser.loon.min.js
vendored
@ -6,7 +6,7 @@
|
|||||||
* ███████║╚██████╔╝██████╔╝ ███████║ ██║ ╚██████╔╝██║ ██║███████╗
|
* ███████║╚██████╔╝██████╔╝ ███████║ ██║ ╚██████╔╝██║ ██║███████╗
|
||||||
* ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
|
* ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
|
||||||
* Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket!
|
* Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket!
|
||||||
* @updated: 2022/6/16 10:27:24
|
* @updated: 2022/6/16 11:22:36
|
||||||
* @version: 2.0
|
* @version: 2.0
|
||||||
* @author: Peng-YM
|
* @author: Peng-YM
|
||||||
* @github: https://github.com/Peng-YM/Sub-Store
|
* @github: https://github.com/Peng-YM/Sub-Store
|
||||||
|
@ -27,6 +27,17 @@ export default function serve() {
|
|||||||
$app.get('/api/utils/env', getEnv); // get runtime environment
|
$app.get('/api/utils/env', getEnv); // get runtime environment
|
||||||
$app.get('/api/utils/backup', gistBackup); // gist backup actions
|
$app.get('/api/utils/backup', gistBackup); // gist backup actions
|
||||||
|
|
||||||
|
// Storage management
|
||||||
|
$app.route('/api/storage')
|
||||||
|
.get((req, res) => {
|
||||||
|
res.json($.read('#sub-store'));
|
||||||
|
})
|
||||||
|
.post((req, res) => {
|
||||||
|
const data = req.body;
|
||||||
|
$.write(JSON.stringify(data), '#sub-store');
|
||||||
|
res.end();
|
||||||
|
});
|
||||||
|
|
||||||
// Redirect sub.store to vercel webpage
|
// Redirect sub.store to vercel webpage
|
||||||
$app.get('/', async (req, res) => {
|
$app.get('/', async (req, res) => {
|
||||||
// 302 redirect
|
// 302 redirect
|
||||||
|
4
backend/sub-store.min.js
vendored
4
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user