Based on the image greyltc/lamp, this image sets up a container running a simple REST API in PHP.
The REST API provides CRUD operations on a mysql database. Resources are mapped into mysql tables. This code is taken from https://www.leaseweb.com/labs/2015/10/creating-a-simple-rest-api-in-php/
Warning : This REST API is for prototyping only! It uses plain HTTP and does not support authentication nor any security feature!
docker run -p80:80 --name restapi -d adrien97nini/itc_rest:latest
In the database provided in the image, a single table is available : HUMIDITY(humidity_value:float, stream_value_time:bigint).
To get all data recorded in this table (GET): navigate to http://vps517683.ovh.net/api.php/HUMIDITY To insert data using curl (POST) :
curl -X POST -H "Content-Type:application/json" -d "{\"humidity_value\": \"40.82617\",\"stream_value_time\": \"1521578771526\"}" http://vps517683.ovh.net/api.php/HUMIDITY/
Start by forking this Github repository, then :
Content type
Image
Digest
Size
335.9 MB
Last updated
over 8 years ago
docker pull adrien97nini/itc_rest