+# Group all api handlers in one router.
+class APIRouter
+ super Router
+
+ # Model to pass to handlers.
+ var model: Model
+
+ # ModelBuilder to pass to handlers.
+ var modelbuilder: ModelBuilder
+
+ # Mainmodule to pass to handlers.
+ var mainmodule: MModule
+
+ # Catalog to pass to handlers.
+ var catalog: Catalog
+
+ init do
+ use("/catalog", new APICatalogRouter(model, mainmodule, catalog))
+ use("/list", new APIList(model, mainmodule))
+ use("/search", new APISearch(model, mainmodule))
+ use("/random", new APIRandom(model, mainmodule))
+ use("/entity/:id", new APIEntity(model, mainmodule))
+ use("/code/:id", new APIEntityCode(model, mainmodule, modelbuilder))
+ use("/uml/:id", new APIEntityUML(model, mainmodule))
+ use("/linearization/:id", new APIEntityLinearization(model, mainmodule))
+ use("/defs/:id", new APIEntityDefs(model, mainmodule))
+ end
+end
+