How to add new endpoint to the API.
apps/api/
package. Here you will find a routes folder that contains the different feature modules of the API. Each module has its own folder and exports all its resolvers.
apps/api/app/server/api/routes
directory. For example, if you want to create a new module called hello
, you would create a new folder called hello
in the apps/api/app/server/api/routes
directory.
apps/api/app/server/api/index.ts
file and aggregate all sub-routers into one main router. To make the module and its endpoints available in the API you need to register a router for this module in the index.ts file:
/api/hello
🎉