This module is responsible for exposing application-level APIs.
Check out the Administrative APIs section for information on administration-level requests.
This module provides a way for modules to register application routes for REST and GraphQL APIs.
Endpoint documentation is automatically generated so as to further facilitate development.
It also provides support for application-level WebSockets.
Just like mostly every other router out there, it does so by relying on three key concepts:
- Input Types
- Return Types
- Functional Handlers
- REST API (based on Express)
- GraphQL API
- Generated Documentation for REST with OpenAPI & Swagger
- Generated Documentation for GraphQL with built-in "description" functionality
- Parameter Validation
- Custom Middleware
This module requires no configuration.
|Conduit Core's address and port
|This should be where this service listens on. If behind a LB it should point to the LB's IP/DNS
|Port to be used by the gRPC server
|Port to be used by admin REST and GraphQL APIs
|Port to be used by admin WebSocket API
|Specifying a secret enables gRPC signed request protection
So how does one register their routes?
Before we elaborate on that, you should first consider the following:
Do I really need custom routes?
Modules automatically handle registering their routes for you.
Therefore, as long as you don't need additional functionality, you don't really need to worry about doing any of that yourself.
Routes are automatically registered or recovered upon bringing up a module, so make sure you start any of the modules you wish to experiment with before checking out Swagger or sending out any requests to these modules.
If you're simply trying to create CRUD endpoints for your database schemas, the answer is most likely "No".
The Database module already covers that use case as custom schemas enabling CRUD operations already come with auto-generated CRUD routes.
It also supports the creation of code-free custom endpoints for your schemas.
You can even accomplish that graphically through the Database section of the Admin Panel too!
I'm fairly sure I do
If you really need to write your own routes from the ground up, you're going to have to build your own custom modules.