Skip to content

Commit

Permalink
feat: Compatible Verdaccio path style
Browse files Browse the repository at this point in the history
  • Loading branch information
fangzhengjin authored Nov 1, 2024
1 parent 4facf90 commit 492a676
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/port/controller/package/DownloadPackageVersionTar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,24 @@ export class DownloadPackageVersionTarController extends AbstractController {
});
return res;
}

// Compatible Verdaccio path style

@HTTPMethod({
// GET /:fullname/-/:scope/:filenameWithVersion.tgz
path: `/:fullname(${FULLNAME_REG_STRING})/-/:scope/:filenameWithVersion.tgz`,
method: HTTPMethodEnum.OPTIONS,
})
async downloadVerdaccioPathStyleorOptions(@Context() ctx: EggContext) {
return this.downloadForOptions(ctx);
}

@HTTPMethod({
// GET /:fullname/-/:scope/:filenameWithVersion.tgz
path: `/:fullname(${FULLNAME_REG_STRING})/-/:scope/:filenameWithVersion.tgz`,
method: HTTPMethodEnum.GET,
})
async downloadVerdaccioPathStyle(@Context() ctx: EggContext, @HTTPParam() fullname: string, @HTTPParam() filenameWithVersion: string) {
return this.download(ctx, fullname, filenameWithVersion);
}
}

0 comments on commit 492a676

Please sign in to comment.