Coder Social home page Coder Social logo

campfinder's Introduction

Hi My name is Mili

Software Engineer / Web Developer

  • ๐Ÿง ย  I'm learning React
  • ๐Ÿคย  I'm open to collaborating on anything that aims to make a difference.

Skills

JavaScript HTML5 React CSS3 Bootstrap TailwindCSS NodeJS Express MongoDB

Socials

My GitHub Stats

Top Languages

campfinder's People

Contributors

milimade avatar

Watchers

 avatar

campfinder's Issues

Use ExpressError class to throw an error if a route is not valid

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.

Add error template

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")

Navbar partial

Description

Add a bootstrap navbar to main boilerplate that every page will have access to

Create a catch-all path

Create a route that catches all invalid pathways. using app.all.
Note: app.all should be placed after all defined routes.

Add validation middleware

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 error handling to new form

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)

Adding random image to seed data

Using the unsplash API url : source.unsplash.com/collection/9046579, update the seedData so that the seed campsite generated are given a random image

Footer partial

Description

Add a footer partial in the same manner that the navbar was added where every page has access to the footer

Validate campground data using JOI

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)

  • Try to get the error message returned with JOI to be displayed on the page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.