You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Elis Hirwing fbcd7bd16c
repl: Handle sell case
3 years ago
public src: Add method to put new items into the inventory 3 years ago
src/Etu src: Add method to put new items into the inventory 3 years ago
.envrc Add direnv and nix shell stuff for environment 3 years ago
.gitignore src: Add a sqlite database 3 years ago
README.org readme: Add API docs 3 years ago
composer.json composer: Install guzzle 3 years ago
composer.lock composer: Install guzzle 3 years ago
repl.php repl: Handle sell case 3 years ago
shell.nix Add direnv and nix shell stuff for environment 3 years ago

README.org

Usage

Run the webserver

php -S localhost:8000 -t public/

API docs

Request stock by item name

curl http://localhost:8000/inventory/item-name

Bring stock down by item name

curl -X DELETE http://localhost:8000/inventory/item-name/amount

Increase stock by item name

curl -X PUT http://localhost:8000/inventory/item-name/amount