nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: add formal types to serialization tests
[nit.git]
/
src
/
web
/
api_graph.nit
diff --git
a/src/web/api_graph.nit
b/src/web/api_graph.nit
index
d58031d
..
13a2177
100644
(file)
--- a/
src/web/api_graph.nit
+++ b/
src/web/api_graph.nit
@@
-19,12
+19,10
@@
import web_base
import dot
import uml
import dot
import uml
-# Group all api handlers in one router.
-class APIGraphRouter
- super APIRouter
-
+redef class APIRouter
init do
init do
- use("/inheritance/:id", new APIInheritanceGraph(config))
+ super
+ use("/graph/inheritance/:id", new APIInheritanceGraph(config))
end
end
end
end
@@
-33,14
+31,11
@@
class APIInheritanceGraph
super APIHandler
redef fun get(req, res) do
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 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
res.send g.draw(pdepth, cdepth).to_svg
end
end