Personal Inventory app
A personal inventory app. useful for keeping track of your stuff, and who you loaned it to.
db.config.js
and either make a postgres db with those params, or change that file to suit your dbnpm install
(a postinstall command runs after this that sets up the tables)npm run local
(Starts the app with supervisor, which will reload js files when they’re edited)npm run dev
(watches web app files and rebuilds them).npm run test
to test the API. App must be running firstCurrent api url is api/v1
There are three endpoints:
category
: categorizaton of itemsuser
: usersitem
: items that a user ownsAll three APIs are identical in structure and usage. In the API below, replace category
with the singular/plural of the other two endpoints, and you’re good to go.
Endpoint | Verb | Result |
---|---|---|
category
| POST | requires a JSON body. will create that category and return the created version/category
| GET | Returns array of all categories (needs to be deprecated) |/category/:id
| GET | Returns category of that id |/categories
| GET | Returns array of categories |/categories?field=value
| GET | returns array of all matches. Search by any field and value. Exact matches, though./category:id
| PUT | needs a JSON body, returns updated category/category/:id
| DELETE | Deletes that category. Returns state