Skip to content
Discussion options

You must be logged in to vote

No. Huma has no generator and does not prescribe a layout. It describes itself as a micro-framework (Why Huma), the docs have no page on project structure, and the tutorial keeps the whole service in package main.

It does give you three pieces for splitting an app by feature the way Nest modules do:

  • huma.Register, huma.Get and the rest take any huma.API, so a feature package can export one function that mounts its routes. The testing tutorial uses that shape (addRoutes(api)) so tests mount the same routes on a humatest API.
  • huma.AutoRegister(api, handler) calls every method on handler whose name starts with Register. A struct that holds its dependencies and has Register... methods is the…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@kasir-barati
Comment options

Answer selected by kasir-barati
Comment options

You must be logged in to vote
1 reply
@kasir-barati
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants