REST API - GET, POST, PUT and DELETE
Example database entry:
{
attribute: <integer>,
created_at: <timestamp> # created automatically,
id: <integer> # primary key - created automatically,
name: <string
}
git clone https://github.com/shintech/bb_mysql_seed
./install
NODE_ENV=development PORT=<port> TZ='America/Chicago' DB_USER=<user> DB_HOST=<host> DB_NAME=<database> DB_PASSWORD=<password> npm start
# to run tests
PORT=<port> TZ='America/Chicago' DB_USER=<user> DB_HOST=<host> DB_NAME=<database> DB_PASSWORD=<password> npm test
Note: use curl, httpie or postman - examples here are given using httpie
http http://<host>:<port>/api/models
http http://<host>:<port>/api/models/<id>
http -f POST http://<host>:<port>/api/models name=<string> attribute=<integer>
http PUT http://<host>:<port>/api/models/<id> name=<string> attribute=<integer>
http DELETE http://<host>:<port>/api/models/<id>
Content type
Image
Digest
Size
312.3 MB
Last updated
about 9 years ago
docker pull shintech/bb_mysql_seed