This is the API for the Peoria Fresh project.
- Node.js
- Express
- bcryptjs
- jsonwebtoken
- Sequelize
- PostgreSQL
Credit to BezKoder's tutorial on JWT Auth with Node.js.
$ npm install
$ flyctl proxy 5432 -a peoriafresh-db
- DATABASE_HOST
- DATABASE_PASSWORD
- DATABASE_USERNAME
- DATABASE_NAME
- TOKEN_SECRET
Ask Evan Wieland for the values of these variables.
$ npm start
$ fly deploy
Methods | Urls | Actions |
---|---|---|
POST | /api/auth/signup | Signup new account |
POST | /api/auth/signin | Login an account |
GET | /api/public/all | Retrieve public content |
GET | /api/public/distributors | Retrieve list of distributors |
GET | /api/public/produce | Retrieve list of produce |
POST | /api/public/consumer/request | Send produce request |
GET | /api/test/admin | Access Admin’s content |
GET | /api/test/consumer | Access Consumer’s content |
GET | /api/distributor | Access Distributor’s content |
GET | /api/test/admin | Access Admin’s content |
GET | /api/distributor/requests | View Distributor’s requests |
GET | /api/producer | View Producer's fulfillments |
GET | /api/producer/fulfillments | View Producer's fulfillments |
POST | /api/producer/fulfillment | Send fulfillment request |