Giter Site home page Giter Site logo

js-quotes's Introduction

Hello, let's build a simple app that allows us to keep track of our favorite quotes and who said it.

If you don't have json-server installed, run $ npm i -g json-server.
If you already have it installed, run the server by: $ json-server --watch db.json.

Deliverables

  • Populate page with quotes with a GET request to http://localhost:3000/quotes.

  • Each quotes should have the following structure:

    <li class="card">
      <blockquote>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
        <p>Someone famous</p>
        <p>Supporters: 0</p>
        <button>Support</button>
        <button>Delete</button>
      </blockquote>
    </li>
    
  • Submitting the form creates a new quote and adds it to the list of quotes without having to refresh the page. (Whether you choose to optimistically render or not is up to you).

  • Clicking the delete button should delete the respective quote from the database and remove it from the page without having to refresh.

  • Clicking the support button will increase the number of supporters for this particular comment in the database and on the page without having to refresh.

API Routes

GET http://localhost:3000/quotes
POST http://localhost:3000/quotes
headers:
{
  "Content-Type": "application/json",
  Accept: "application/json"
}

data:
{
  quote: "Don't count the days, make the days count.",
  supporters: 0,
  author: "Mike Tyson"
}
PATCH http://localhost:3000/quotes/:id
headers:
{
  "Content-Type": "application/json",
  Accept: "application/json"
}

data:
{
  supporters: 1
}
DELETE http://localhost:3000/quotes/:id

js-quotes's People

Contributors

sjbao avatar thuyanduong-flatiron avatar realandrewcohn avatar

Watchers

James Cloos 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.