Skip to content

Commit 6725d2d

Browse files
committed
Merge: nitweb: nitcorn based API to access model and source code
Description from man page: # 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). Pull-Request: #1889 Reviewed-by: Jean Privat <jean@pryen.org>
2 parents cd76d70 + 11fbbb1 commit 6725d2d

File tree

11 files changed

+1338
-514
lines changed

11 files changed

+1338
-514
lines changed

share/man/nitweb.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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

Comments
 (0)