fix: 同步接口支持 POST

This commit is contained in:
xream 2024-01-13 19:56:30 +08:00
parent d96a0421f7
commit ba251ced34
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.151",
"version": "2.14.152",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {

View File

@ -19,8 +19,14 @@ export default function register($app) {
if (!$.read(ARTIFACTS_KEY)) $.write({}, ARTIFACTS_KEY);
// sync all artifacts
$app.get('/api/sync/artifacts', syncAllArtifacts);
$app.get('/api/sync/artifact/:name', syncArtifact);
$app.get('/api/sync/artifacts', syncAllArtifacts).post(
'/api/sync/artifacts',
syncAllArtifacts,
);
$app.get('/api/sync/artifact/:name', syncArtifact).post(
'/api/sync/artifact/:name',
syncArtifact,
);
}
async function produceArtifact({