This application is a JSON based RESTful implementation of a guest book. Its only dependency is a Postgres database. The application will generate it's own required DB schema on startup.
The application listens on port 5000 once its completed booting.
GET /api/healthA health check endpoint that returns 200 OK when the app is up, healthy and able to connect to the database
GET /api/guestsReturns an array of people that have signed the guest book, e.g.
[
{
"id": "a811e354-a522-4dd5-b781-02466cf6f194",
"firstName": "Hilbert",
"lastName": "Metz",
"created": "2020-08-24T02:53:24.133Z"
},
{
"id": "823b20b4-cc95-4188-a82b-978070d34216",
"firstName": "Myrtie",
"lastName": "Ankunding",
"created": "2020-08-24T02:53:29.105Z"
}
]
POST /api/guestsCreates an entry in the guest book. It expects a body in the following format:
{
"firstName": "Hilbert",
"lastName": "Metz"
}
The application uses a combination of a config file and environment variable to obtain its config.
The application loads its configuration from a YAML file on disk that should be mounted to the container.
This configuration file should contain two mandatory fields:
environment: A simple environment descriptor used to refer to the environment (e.g. development, test, QA)database: A Postgres connection URI (https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING)Below is an example:
environment: development
database: postgresql://mydbuser:mysecretpassword@mydbhost/mydbname
BACKEND_CONFIG: The path on disk to the above config file that will be loaded on startupFor example:
BACKEND_CONFIG=/etc/mybackend/config.yml
Content type
Image
Digest
Size
108.1 MB
Last updated
about 6 years ago
docker pull zcnm/backend