diff --git a/app/port/controller/PackageVersionFileController.ts b/app/port/controller/PackageVersionFileController.ts index d68db1ed..8881ed0e 100644 --- a/app/port/controller/PackageVersionFileController.ts +++ b/app/port/controller/PackageVersionFileController.ts @@ -170,6 +170,18 @@ export class PackageVersionFileController extends AbstractController { } return await this.distRepository.getDistStream(file.dist); } + + @HTTPMethod({ + path: `/:fullname@versionSpec/:path(.+)`, + method: HTTPMethodEnum.GET, + }) + async rawNpm(@Context() ctx: EggContext, + @HTTPParam() fullname: string, + @HTTPParam() versionSpec: string, + @HTTPParam() path: string, + @HTTPQuery() meta: string) { + return await this.raw(ctx, fullname, versionSpec, filepath, meta); + } /** * compatibility with unpkg