Giter Site home page Giter Site logo

expressintrochallenges's Introduction

Express Assignments

This is a two parter! Complete part one and then we will regroup and discuss the challenge. After that we'll go for part two!

Part One:

Challenge 1:

Create a GET route for "/hello" that returns the response "Hello!".

Challenge 2:

Create a POST route for "/create/:name" that returns a json object that looks like this: { "id":1, "name":"the name they pass in the route" }

Challenge 3:

Create a GET route for "/" that returns the index.html file.

Challenge 4:

Create a GET route for "/verify/:age" that checks if the age is greater than 13. If it is then it sends a 200 status response (for all good). If it is not greater than 13 then send a 403 status code. For more information on what status codes mean refer to this - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

Part Two:

Challenge 1:

Create a POST route for "/create/:name/:age" that creates an object that looks like this: { "name": "troy", "age": 20 } Then take that object and insert it into storage.json

Challenge 2:

Create a Get route for "/" that returns all of the objects inside storage.json.

Challenge 3:

Create a Get route for "/:name" that returns the first object in storage.json that matches the name. If there is no object in storage.json that matches then return a 400 status.

Challenge 4 (stretch):

Modify your logic so every object has and id field that automatically goes up by one for every object inserted (first object has an id of 1, second object has an id of 2 ect). Then modify challenge 3 so that it finds the object by an id instead of by name.

expressintrochallenges's People

Contributors

bmcgrane302 avatar

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.