Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
glngn
glngn-server-examples
Commits
65d11cf7
Commit
65d11cf7
authored
Nov 21, 2019
by
Corey O'Connor
Browse files
Update README.md
parent
4c6f92d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
8 deletions
+41
-8
README.md
README.md
+41
-8
No files found.
README.md
View file @
65d11cf7
...
...
@@ -87,7 +87,7 @@ INFO glngn.server.app.ServerApp$ - application is listening at http://localhos
At this point the standalone server is initialized and ready.
See
[
docs/Deep Dives
](
https://gitlab.com/glngn/glngn-server-examples/blob/master/docs/DeepDives.md
)
for more
information on what exactly that means
.
for more
details on what happened
.
Hit control-C, or TERM the process (there is only one), to shut down the server. This will take a bit
for a nice, coordinated shutdown. Which is preferred. That said, the server is configured to attempt
...
...
@@ -95,7 +95,7 @@ recovery from sudden terminations. Such as killing a container in a kubernetes c
## Examining a Running Server
Even in this default configuration the server provides
a few
useful routes:
Even in this default configuration the server provides useful routes:
### Health Check
...
...
@@ -107,24 +107,57 @@ OK
This will only return status 200 OK if the server is able to handle requests. Not terribly
interesting so far, but we haven't done much! Nice to verify the server health before proceeding tho.
Worth pointing out that we implicitly requested the text representation of the resource using a
`.txt`
suffix. We could have requested another representation, such as json, explicitly or implicitly:
```
bash
$
curl
-H
'Accept: text/plain'
localhost:10000/healthz
OK
$
curl
-H
'Accept: application/json'
localhost:10000/healthz
{
"memStats"
:
{
[
...]
"ok"
:
true
}
$
curl localhost:10000/healthz.json
{
"memStats"
:
{
[
...]
"ok"
:
true
}
```
This pattern is supported throughout: Endpoints will have suffixed versions that imply the expected
representation.
### OpenAPI schema
Let's query for the
(current)
API schema to see what
else
there
is
:
Let's query for the API schema to see what
other endpoints
there
are
:
```
bash
$
curl http://localhost:10000/openapi.json
{
"openapi"
:
"3.0.1"
,
"info"
:
{
"title"
:
"dynamic"
,
"version"
:
"0.1"
}
"info"
:
{
"title"
:
"dynamic"
,
"version"
:
"0.1"
}
,
"paths"
:
{
"/healthz"
:
{
[
...]
}
}
[
...]
```
Only a few paths are highlighted in the sample output above. Let's touch on those briefly:
1.
The
`/healthz`
route. We've already tried that one
### A Brief Tour
TODO: o over the general types of default routes)
TODO:
G
o over the general types of default routes)
-
`_ops`
routes - routes prefixed with a
`_`
. These are automatically generated.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment