Running the Example
|
Ensure that you have installed the prerequisites. |
-
Build the Docker image:
$ node --run docker:build -
Start the image (HTTP server):
$ node --run docker:start -
Stop the image:
$ node --run docker:stop -
Create a self-signed certificate:
$ node --run cert:create -
Start the image (HTTPS server):
$ node --run docker:start:secure
Example REST API
The example exposes two endpoints:
/-
returns a randomly generated user in JSON format
/-/health/liveness-
liveness probe
$ curl http://localhost:3000/
$ curl http://localhost:3000/-/health/liveness
$ curl --insecure https://localhost:3000/
$ curl --insecure https://localhost:3000/-/health/liveness