Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This Pull Request aims to enhance the ZumitoFramework by introducing user routing functionality, empowering developers to publish endpoints on their bot via an express server. The primary addition is the creation of a new class called
FrameworkRouter
, dedicated to be extended by developers who want to create new routesChanges Introduced:
FrameworkRouter
, has been added to the ZumitoFramework. This class is responsible for handling all routing-related tasks.FrameworkRouter
class is exported in theindex.ts
file for accessibility across the framework.FrameworkRouter
class includes a constructor for setting up abasePath
and an abstract methodgetRoutes()
, enhancing flexibility and customization.registerRoutes()
andgetRoutes()
, have been added to the Module class for registering and retrieving routes, respectively.Objective:
These modifications are geared towards improving the route handling capabilities of the ZumitoFramework. By introducing user routing functionality and refining the routing process, this Pull Request seeks to enhance the framework's flexibility and usability, ultimately empowering developers to build more robust and efficient bots.
Implementation
Here is an example of a route implementantion on a bot
src/modules/general/routes/Example.ts