import dot
import uml
-# Group all api handlers in one router.
-class APIGraphRouter
- super APIRouter
-
+redef class APIRouter
init do
- use("/inheritance/:id", new APIInheritanceGraph(model, mainmodule))
+ super
+ use("/graph/inheritance/:id", new APIInheritanceGraph(config))
end
end
super APIHandler
redef fun get(req, res) do
+ var mentity = mentity_from_uri(req, res)
+ if mentity == null then return
var pdepth = req.int_arg("pdepth")
var cdepth = req.int_arg("cdepth")
- var mentity = mentity_from_uri(req, res)
- if mentity == null then
- res.error 404
- return
- end
- var g = new InheritanceGraph(mentity, view)
+ var g = new InheritanceGraph(mentity, config.view)
res.send g.draw(pdepth, cdepth).to_svg
end
end