Addons DevPre-alpha
Custom HTTP route
Register addon-specific HTTP handlers from an addon controllers/ package.
Example: invoice print
File: sumeru_addons/account/controllers/invoice_print.go
router.Register(http.MethodGet, "/account/invoice/print", router.AuthSession, InvoicePrintHandler)
The handler reads query params (e.g. id=), loads account.move, renders HTML for printing.
Steps for your addon
- Create
controllers/my_handler.go - Call
router.Registerininit()with appropriate auth:
- router.AuthNone — public
- router.AuthSession — signed-in user
- Blank-import controllers from addon
init.go - Run
make generateand restart server
Auth notes
Session routes use the same ACL context as the web UI. For machine clients, prefer JSON-RPC with API keys.