This repo contains the backend for the inventory manager. It is a gofiber app that uses a postgres database to store information about the inventories.
- Go
- Postgres
- Clone the repo
- Run
go buildin the root directory - Run the binary
To create an inventory, you can use the following command:
curl -X POST -H "Content-Type: application/json" -d '{"name": "My Inventory"}' http://localhost:3000/api/inventories
This will create a new inventory with the name "My Inventory".
To get all inventories, you can use the following command:
curl -X GET http://localhost:3000/api/inventories
This will return a JSON array containing all the inventories.
To get a specific inventory, you can use the following command:
curl -X GET http://localhost:3000/api/inventories/1
This will return a JSON object containing the details of the inventory with the ID 1.
To update an inventory, you can use the following command:
curl -X PUT -H "Content-Type: application/json" -d '{"name": "New Name"}' http://localhost:3000/api/inventories/1
This will update the name of the inventory with the ID 1 to "New Name".
To delete an inventory, you can use the following command:
curl -X DELETE http://localhost:3000/api/inventories/1
This will delete the inventory with the ID 1.