The Caffeine Manager allows its users to manage and monitor their caffeine intoxication and helps them to administer their caffeine level
The Caffeine Manager allows its users to manage and monitor their caffeine intoxication and helps them to administer their caffeine level
Markéta Wachtlová
cpanfile specifies exact modules versions
psql < create.sql
plugins:
Pg:
host: 'localhost'
port: '5432'
base: 'caffeine_manager'
username: ''
password: ''
plackup -r bin/app.psgi
Standalone server that serves the application is listening on port 5000.
perl Makefile.PL
make test
curl -X PUT -H "Content-Type: application/json" -d '{"login":"login", "email":"email@email.com","password":"password"}' http://0.0.0.0:5000/user/request
curl -X POST -H "Content-Type: application/json" -d '{"name":"name", "caffeine":12}' http://0.0.0.0:5000/machine
curl http://0.0.0.0:5000/coffee/buy/1/1
curl http://0.0.0.0:5000/stats/level/user/1
Every POST/PUT request accepts json object with keys described below.
Every request returns json object with
* status 200 with described keys on success
* status 4xx with optional json error object with mandatory keys
* error_code
* error_text
PUT /user/request
POST /machine
GET /coffee/buy/:user-id/:machine-id
PUT /coffee/buy/:user-id/:machine
GET /stats/coffee
GET /stats/coffee/machine/:id
GET /stats/coffee/user/:id
GET /stats/level/user/:id