A redesigned front-end website for the Iowa State University online WebFood ordering system
These instructions work on Linux and should work on Windows or Mac.
To install, first make sure you have nodejs and npm installed. Additionally, python (version 2) is required to build some of the dependencies in the project.
Clone the repo, go into it's root folder, and have npm pull the dependencies for the project:
npm install
Lastly, start the server:
npm start
# Or, for debugging mode (extra logging to the console):
DEBUG=WebFood npm start
# Optionally use a port other than 3000:
PORT=9000 npm start
Then navigate to http://localhost:3000 (or whatever port was chosen)
POST /auth/login
Attempts to login to the system and start a session.
Request Body:
json with username and password fields: { "username": "<username>", "password": "<password>" }
Response Body (success): json object with user property, containing informatin about the user. Starts a session.
POST /auth/register
Attempt to register a user.
Request Body:
json with a username and password field (see /auth/login
route)
Response Body (error): If an error occurs, such as the user already exists, a 400 Bad Request response is sent back
Response Body (success): Sends back information about the newly registered user and logs them in
POST /api/create-order
Create a new order
Request Body: { "location": "", "price": Number, "entree": "", "beverage": "", "sides": ["sides1", "side2"], "other": "..." } Response: { "_id": Number, "location": "", "price": Number, "entree": "", "beverage": "", "sides": ["sides1", "side2"], "other": "..." }