A repo of CRUD examples that uses different embedded containers, instead of the default which is Tomcat.
A TODO/CRUD application connected to a Postgres database using Jetty as its embedded container.
Create an Azure Database for PostgreSQL instance and set the following environment variables in the application.properties
file to the below:
-
${POSTGRES_HOST}
: The host name of your Postgres server -
${POSTGRES_DATABASE_NAME}
: The name of your Postgres database. Thejetty
example uses 'jettytodos'. Refer to thejetty/database
folder. -
${POSTGRES_USER}
: The Postgres username -
${POSTGRESL_PASSWORD}
: Your Postgres password -
Routes:
/api/v1/todo/add
: A POST request to add new tasks./api/v1/todo/delete
: A DELETE request to delete a todo by ID./api/v1/todo/find/{id}
: A GET request to find a todo by ID./api/v1/todo/all
: A GET request to get all todos.
A CRUD application to add books connecting to a MySQL database using Undertow as its embedded container.
Create an Azure Database for MySQL instance and set the following environment variables in the application.properties
file to the below:
-
${MYSQL_HOST}
: The host name of your MySQL server -
${MYSQL_DATABASE_NAME}
: The name of your MySQL database. Theundertow
example uses 'undertowbooks'. Refer to thejetty/database
folder. -
${MYSQL_USER}
: The MySQL username -
${MYSQL_PASSWORD}
: Your MySQL password -
Routes:
/api/v1/books/add
: A POST request to add new books./api/v1/books/delete
: A DELETE request to delete a book by ID./api/v1/books/find/{id}
: A GET request to find a book by ID./api/v1/books/all
: A GET request to get all books.
-
Both examples have a Swagger endpoint available to them by accessing the
/swagger-ui/
endpoint.