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.
this.controllers.forEach(controller => { let router = express.Router(); router.use(controller.path, controller.router); this.app.use("/api", router); console.log("Initialized Controller for /api" + controller.path) })
this.controllers.forEach(controller => { let router = express.Router(); router.use(controller.path, controller.router); this.app.use("/api", router); console.log("Initialized Controller for /api" + controller.path) })
Then i used a paramRouter to pass other routes after :param(like serverId) for example (/api/servers/99999/config