|
| 1 | +# NAME |
| 2 | + |
| 3 | +nitweb - provide a web API to nit model and source code. |
| 4 | + |
| 5 | + |
| 6 | +# SYNOPSIS |
| 7 | + |
| 8 | +nitweb [*options*] FILE... |
| 9 | + |
| 10 | + |
| 11 | +# DESCRIPTION |
| 12 | + |
| 13 | +`nitweb` use `nitcorn` actions to provide an API to loaded model and source code. |
| 14 | + |
| 15 | +Usage: |
| 16 | + |
| 17 | +~~~sh |
| 18 | +nitweb --host localhost --port 3000 lib/core/ |
| 19 | +~~~ |
| 20 | + |
| 21 | +### `GET /` HOME |
| 22 | +Show the home page of the webserver. |
| 23 | +Display all the loaded model entities in a tree. |
| 24 | + |
| 25 | +### `GET /search/:namespace` SEARCH BY NAMESPACE |
| 26 | +Search all model entities matching `namespace`. |
| 27 | + |
| 28 | +It is possible to retrieve the result as a JsonArray instead of raw html |
| 29 | +using the uri param `json=true` (default `false`). |
| 30 | + |
| 31 | +### `GET /code/:namespace` SHOW SOURCE CODE |
| 32 | +Display the source code of the entity matching `namespace`. |
| 33 | + |
| 34 | +### `GET /doc/:namespace` DOCUMENTATION PAGE |
| 35 | +Display a short documentation page about the entity matching `namespace`. |
| 36 | + |
| 37 | +### `GET /random/` RANDOM LIST |
| 38 | +Display a random list of entities found in the model. |
| 39 | + |
| 40 | +The list is parametrable with the following uri params: |
| 41 | +* `n=10` size of the list (default `10`) |
| 42 | +* `k=modules` kind of entities in the list (default `modules`) |
| 43 | + |
| 44 | +It is possible to retrieve the result as a JsonArray instead of raw html |
| 45 | +using the uri param `json=true` (default `false`). |
| 46 | + |
| 47 | +# OPTIONS |
| 48 | + |
| 49 | +### `--host` |
| 50 | +The host to bind the web server on. |
| 51 | + |
| 52 | +### `--port` |
| 53 | +Port number to use |
| 54 | + |
| 55 | +### `-h`, `-?`, `--help` |
| 56 | +Show Help (the list of options). |
| 57 | + |
| 58 | +# SEE ALSO |
| 59 | + |
| 60 | +* nitcorn |
| 61 | +* nitdoc |
0 commit comments