This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class ApiModule extends Hapiest.HapiestModule { | |
| public routeSets = [UserApiRoutes]; | |
| public baseUrl = baseUrl; | |
| } | |
| export class AdminModule extends Hapiest.HapiestModule { | |
| public routeSets = [AdminRoutes]; | |
| public auth = "simple"; // Overrides auth for all routes under this. | |
| public baseUrl = `${baseUrl}/admin`; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Now I want user api to be available for admin | |
| // may be I want to show in dashboard | |
| export class ApiModuleForAdmin extends ApiModule { | |
| public auth = "simple"; | |
| public baseUrl = `${baseUrl}/admin/user-apis${baseUrl}`; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const hapiServer = new Server({ | |
| host: env.APP_HOST, | |
| port: env.APP_PORT, | |
| routes: { cors: true }, | |
| }); | |
| (async () => { | |
| await hapiServer.route(new ApiModule().getRoutes()); | |
| await hapiServer.route(new ApiModuleForAdmin().getRoutes()); | |
| await hapiServer.route(new AdminModule().getRoutes()); |
OlderNewer