fix: 同步接口支持 POST

This commit is contained in:
xream
2024-01-13 19:56:30 +08:00
parent d96a0421f7
commit ba251ced34
2 changed files with 9 additions and 3 deletions

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({