npm install
createdb ssv_practice_dev
knex migrate:latest
knex seed:run
nodemon
or nodemon ./bin/www
open localhost:3000 in the browser to view the project and play
- The project, as is, includes handwritten back-end validation.
- This means that this is an appropriate way to handle back-end validation -- that is, using if/else statements and multiple res.status.send commands to send the correct error message for particular cases.
- Try to pick out how certain error messages are forwarded to the client based on user inputs.
- However, Joi and Express-Validation can automate a lot of this validation and can be especially helpful for situations in which you must validate more complex fields.
- Attempt to re-factor the code to use Joi and Express-Validation so that less if/else statements are needed to retrieve the error messages generated by Joi.