Web & gRPC Server¶
UI¶
$ ./enola server --model file:docs/use/library/model.yaml --httpPort=8080
HTTP JSON REST API + HTML UI server started; open http://0:0:0:0:0:0:0:0:8080/ui ...
You can now open e.g. http://localhost:8080/ui/demo.book/ABC/0-13-140731-7/1
to view this demo.book
Entity. When you click on the Related kind
you will
see its demo.book_kind
, where you can click e.g. on its google
Link.
REST¶
There is also a REST API which returns JSON if you replace ui
with api
in the URL,
so e.g. on http://localhost:8080/api/entity/demo.book/ABC/0-13-140731-7/1.
gRPC¶
The --grpcPort
flag starts the Enola gRPC API.
This can be used by the Enola CLI Client’s --server
flag, instead of passing a --model
file, like so:
$ ./enola server --model file:docs/use/library/model.yaml --grpcPort=7070
gRPC API server now available on port 9090
$ ./enola get --server localhost:7070 demo.book/ABC/0-13-140731-7/1
which will output:
id:
ns: demo
entity: book
paths: [ABC, 0-13-140731-7, '1']
ts: 2023-12-02T20:51:44.134467Z
related:
library:
ns: demo
entity: library
paths: [ABC]
kind:
ns: demo
entity: book_kind
paths: [0-13-140731-7]
This is the same as a direct “in-process” Get Entity would have:
./enola get --model file:docs/use/library/model.yaml demo.book/ABC/0-13-140731-7/1