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.
Create new module
To create a new module, simply create a new folder in theapps/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/routes/hello/index.ts
Register router
We create a separate Hono route in theapps/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:
apps/api/app/server/api/index.ts
/api/hello
🎉