Skip to content

Commit

Permalink
✔ Test /api/* Prefix ~
Browse files Browse the repository at this point in the history
  • Loading branch information
bifeldy committed May 9, 2023
1 parent 8bde00a commit 5c6a97f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dist/fansubid/browser/ngsw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configVersion": 1,
"timestamp": 1683652263021,
"timestamp": 1683654147098,
"index": "/index.html",
"assetGroups": [
{
Expand Down
2 changes: 1 addition & 1 deletion dist/fansubid/server/main.js

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions src/api/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,28 +297,28 @@ export class AppModule {
configure(mc: MiddlewareConsumer) {
mc.apply(UrlXmlMiddleware).forRoutes({ path: '*', method: RequestMethod.ALL });
mc.apply(ApiKeyMiddleware).exclude(
{ path:'/aktivasi', method: RequestMethod.GET },
{ path:'/verify-sosmed', method: RequestMethod.GET }
{ path: '/api/aktivasi', method: RequestMethod.GET },
{ path: '/api/verify-sosmed', method: RequestMethod.GET }
).forRoutes({ path: '*', method: RequestMethod.ALL });
mc.apply(BannedMiddleware).exclude(
{ path:'/aktivasi', method: RequestMethod.GET },
{ path:'/verify-sosmed', method: RequestMethod.GET },
{ path:'/login', method: RequestMethod.POST },
{ path:'/register', method: RequestMethod.POST },
{ path:'/lost-account-*', method: RequestMethod.POST }
{ path: '/api/aktivasi', method: RequestMethod.GET },
{ path: '/api/verify-sosmed', method: RequestMethod.GET },
{ path: '/api/login', method: RequestMethod.POST },
{ path: '/api/register', method: RequestMethod.POST },
{ path: '/api/lost-account-*', method: RequestMethod.POST }
).forRoutes({ path: '*', method: RequestMethod.ALL });
mc.apply(LoginMiddleware).forRoutes({ path:'/login', method: RequestMethod.POST });
mc.apply(RegisterMiddleware).forRoutes({ path:'/register', method: RequestMethod.POST });
mc.apply(LogoutMiddleware).forRoutes({ path:'/logout', method: RequestMethod.DELETE });
mc.apply(LoginMiddleware).forRoutes({ path: '/api/login', method: RequestMethod.POST });
mc.apply(RegisterMiddleware).forRoutes({ path: '/api/register', method: RequestMethod.POST });
mc.apply(LogoutMiddleware).forRoutes({ path: '/api/logout', method: RequestMethod.DELETE });
mc.apply(CacheMiddleware).forRoutes({ path: '*', method: RequestMethod.GET });
mc.apply(throttle(CONSTANTS.attachmentSpeedLimiterBps)).forRoutes(
{ path: '/attachment', method: RequestMethod.GET },
{ path: '/ddl-part', method: RequestMethod.GET },
{ path: '/ddl-seek', method: RequestMethod.GET }
{ path: '/api/attachment', method: RequestMethod.GET },
{ path: '/api/ddl-part', method: RequestMethod.GET },
{ path: '/api/ddl-seek', method: RequestMethod.GET }
);
mc.apply(
uploadx.upload({
path: '/attachment',
path: '/api/attachment',
allowMIME: CONSTANTS.fileTypeAttachmentAllowed,
directory: environment.uploadFolder,
maxUploadSize: CONSTANTS.fileSizeAttachmentTotalLimit,
Expand All @@ -332,8 +332,8 @@ export class AppModule {
}
})
).forRoutes(
{ path: '/attachment', method: RequestMethod.POST },
{ path: '/attachment', method: RequestMethod.PUT }
{ path: '/api/attachment', method: RequestMethod.POST },
{ path: '/api/attachment', method: RequestMethod.PUT }
);
}

Expand Down

0 comments on commit 5c6a97f

Please sign in to comment.