Coder Social home page Coder Social logo

fetch-hedgehog-party's Introduction

Fetch Refresher - Hedgehog Party

Hedgehog Party is an application designed for the Fetch Lesson for Turing Schools Back-End Module 4 students. This repo includes the front-end (built in jQuery) and Express server.

Your Task

Clone down the repo and follow setup instructions. Look through the JavaScript in public/index.js - we already have a get request up and running to get, then append, all the hedgies in the database onto the DOM. Make sure you open up the app in the browser and keep your Dev Tools open while working. You should be pairing with your Quantified Self partner for this activity.

Step 1: Choose a driver. Together, write the request to POST a new hedgehog. See the README for info on what is expected in the request.

Step 2: Now, the other partner should drive. Work together to write the request to DELETE a hedgehog from the invite list.

NOTE: Both tasks require network requests as well as DOM manipulation. This is good practice for Quantified Self/Play😊

Setup

  • Fork or clone this repo
  • Run npm install
  • Run npm start

Deployed API

https://hedgehog-party.herokuapp.com/

Endpoints

GET /api/v1/invites

Example Response:

[
  {
    "id": 1,
    "name": "Sonic",
    "hoglets": 3,
    "allergies": "none",
    "created_at": null
  },
  {
    "id": 2,
    "name": "Shark",
    "hoglets": 7,
    "allergies": "rice",
    "created_at": null
  },
  {
    "id": 3,
    "name": "Sunny",
    "hoglets": 0,
    "allergies": "spicy foods",
    "created_at": null
  }
]

POST /api/v1/invites

Expected Request Format:

 {
    "name": "Sofie",
    "hoglets": 3,
    "allergies": "advil"
  }

Successful Return Value:

{
    "id": 219
}

If one of the required properties is missing in post request, a 422 status code along with a response body informing you of the first missing property:

{
    "error": "You are missing the <name/hoglets/allergies> property."
}

DELETE /api/v1/invites/:id

No return value on a successful delete.

fetch-hedgehog-party's People

Contributors

ameseee avatar

Watchers

 avatar  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.