X-Git-Url: http://nitlanguage.org diff --git a/share/man/nitweb.md b/share/man/nitweb.md new file mode 100644 index 0000000..51cd6f0 --- /dev/null +++ b/share/man/nitweb.md @@ -0,0 +1,61 @@ +# NAME + +nitweb - provide a web API to nit model and source code. + + +# SYNOPSIS + +nitweb [*options*] FILE... + + +# DESCRIPTION + +`nitweb` use `nitcorn` actions to provide an API to loaded model and source code. + +Usage: + +~~~sh +nitweb --host localhost --port 3000 lib/core/ +~~~ + +### `GET /` HOME +Show the home page of the webserver. +Display all the loaded model entities in a tree. + +### `GET /search/:namespace` SEARCH BY NAMESPACE +Search all model entities matching `namespace`. + +It is possible to retrieve the result as a JsonArray instead of raw html +using the uri param `json=true` (default `false`). + +### `GET /code/:namespace` SHOW SOURCE CODE +Display the source code of the entity matching `namespace`. + +### `GET /doc/:namespace` DOCUMENTATION PAGE +Display a short documentation page about the entity matching `namespace`. + +### `GET /random/` RANDOM LIST +Display a random list of entities found in the model. + +The list is parametrable with the following uri params: +* `n=10` size of the list (default `10`) +* `k=modules` kind of entities in the list (default `modules`) + +It is possible to retrieve the result as a JsonArray instead of raw html +using the uri param `json=true` (default `false`). + +# OPTIONS + +### `--host` +The host to bind the web server on. + +### `--port` +Port number to use + +### `-h`, `-?`, `--help` +Show Help (the list of options). + +# SEE ALSO + +* nitcorn +* nitdoc