Nested Router with @sapphire/plugin-api
Hello guys, iam really new to this framework. i would like to integrate my express to my sapphire project.
In my old project i was using nested routers.
Here are some references from my old project:
This was registering all my controllers like /servers or /users, i know the plugin-api does this automatically.
Then i used a paramRouter to pass other routes after :param(like serverId) for example (/api/servers/99999/config
so my question is can i do this with the plugin-api?
Solution:Jump to solution
routes/servers/server.ts
with a route
option in the constructor of servers/:serverId
routes/servers/server/config.ts
with a route
option in the constructor of servers/:serverId/config
example: https://github.com/skyra-project/skyra/blob/main/src/routes/guilds...2 Replies
Solution
routes/servers/server.ts
with a route
option in the constructor of servers/:serverId
routes/servers/server/config.ts
with a route
option in the constructor of servers/:serverId/config
example: https://github.com/skyra-project/skyra/blob/main/src/routes/guildsokay