- ๐ง ย I'm learning React
- ๐คย I'm open to collaborating on anything that aims to make a difference.
My GitHub Stats
The ExpressError should be thrown in the app.all route and using the next() middleware it should return a response from the last app.use. Destructure the error to return the variables defined in ExpressError class and return the status and message. You can give the status and message a default value when destructuring.
Create a new error.ejs view and adda bootstrap alert. In the app.use route, render and pass through the err variable to the error.ejs view. Also add a conditional to check if the error message is empty and then set the message to default value (err.message = "something something")
Create a class called ExpressError that extends the Error class
Add validation to the form to create a new campground using bootstrap form validation [https://getbootstrap.com/docs/5.0/forms/validation/]
Add a bootstrap navbar to main boilerplate that every page will have access to
Create a route that catches all invalid pathways. using app.all.
Note: app.all should be placed after all defined routes.
Add validation to the edit form using the bootstrap validation [https://getbootstrap.com/docs/5.0/forms/validation/]
Define and use middleware to validate inputs.
Move the validation into a middleware function set to a variable and add middleware to the routes that need it. The middleware should be called before the parameters of the route.
Add very basic error handling for async errors that might occur with mongo
If the campground input for the new form is empty, throw an ExpressError err (the work throw must be used because it is in an async function)
Using the unsplash API url : source.unsplash.com/collection/9046579, update the seedData so that the seed campsite generated are given a random image
Add a footer partial in the same manner that the navbar was added where every page has access to the footer
Install and import JOI (https://joi.dev/)
Create a JOI schema in the post route for a new campground where campground is an object and required. Under the campground JOI object add your keys that are under campground. For each key define what type it is and whether it's required and/or any other parameters needed for each key.
Under the variable result, validate req.body against the campground schema and console.log(result)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.