Welp! Can't decide :/
Frustrated from your group of friends couldn't decide on a place to eat? Well, introducing Welp! for those moments where you let a random algorithm decide your meal.
To get started: clone down a version of this application using the top right clone/copy git clone button.
once into Terminal, make sure you have npm and git accessible.
run npm install
in one terminal, and npm run build in another
On success: you should be able to see the following message: "Successfully connected to Welp! on http://localhost:3333/"
Navigate to your browser and enter the URL http://localhost:3333/
Demo:
For Review use purpose:- npm install
- npm run init-database
- npm run build
- npm start
- Setup express.js to provide routing & basic CRUD endpoints to accommodate with front-end functionality
- Check Express.js official docs to get started
- Define port with port number 3333
- Set up relevant middlewares alongside with express (body parser, CORS, morgan, etc)
- Serve static files (html, css) in /client/public folder using
express.static
- Understand the purpose of '/' argument in serving static files
- Direct all requests after the url '/api' with express router
- Initialize the express server with listen method, providing port and callback
- Initialize router.js file with require statements.
- Create a route to '/add' with a POST request to invoke
addOne()
in controllers.js - export router object
- Fill in request handling in controller.js for
addOne()
method (refer to official docs if needed) - Test '/add' endpoint via Postman
- Create a route to '/all' with a GET request to invoke
getAll()
in controllers.js - Fill in request handling in controller.js for
getAll()
method (refer to official docs if needed) - Test via Postman
- Create a route to '/all' with a DELETE request to invoke
deleteAll()
in controllers.js - Fill in request handling in controller.js for
deleteAll()
method (refer to official docs if needed) - Test via Postman
- Create a route to '/deleteOne/:id' with a DELETE request to invoke
deleteOne()
in controllers.js - Fill in request handling in controller.js for
deleteOne()
method (refer to official docs if needed) - Test via Postman
- Add an UPDATE endpoint to your routes for update functionality (requires further front-end integration)
- Serve an ABOUT page with express static