Embed H2 programmatically with a REST API using SpringBoot and Spring Security
The H2 Web Console is available on deployed instance
To login use the ADMIN role credentials found in: org.systemexception.h2embedded.SecurityConfig
or use jdbc url and user/password from application.properties
Check the bundled documentation
Actuators are deployed (e.g.), verify management.port
in application.properties
:
Further endpoints: Spring Reference
Use postman or curl to interact with data, e.g.
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data '{"dataValue":"'$data'"}' http://xxx.xxx.xxx.xxx:8080/api/data -u user:password
Additionally a JMeter test plan is available.
Check credentials in org.systemexception.h2embedded.SecurityConfig
and add them to your REST utility for basic authentication.
A very basic frontend is available
- to add an item enter the data to be saved and click the + icon
- to update an item click the value, edit it and click update