Skip to content

Latest commit

 

History

History
69 lines (46 loc) · 2.7 KB

readme.md

File metadata and controls

69 lines (46 loc) · 2.7 KB

General Assembly Logo

Express API Lab

For this lab, you will be creating a backend for a completed frontend application. You will be working on an app called "GAphy" which will display a bunch of Gifs.

The frontend application has full CRUD functionality, your job is to create the backend code to make it functional!

Instructions

  1. Fork and clone this repository.
  2. Change into the new directory.
  3. Fulfill the listed requirements.

Build out your backed in the backend/ directory.

Requirements

You must create an API that runs at http://localhost:3000/gifs. You must have a few different routes:

  • GET /gifs which will list out all gifs
  • POST /gifs which will add a new gif and return a list of all gifs
  • PUT gifs/:gifId which will update a gif and redirect to the list of all gifs
  • DELETE gifs/:gifId which will delete a gif and redirect to the list of all gifs

You should have your database set up to store a collection of gifs. Your model should have two attributes:

  • a name for the name of a gif
  • a url for the url of the gif

If these are named differently, you will have to change the frontend!

You should also set up a seed file to load some default gifs into your database. We recommend using the Giphy site to get gifs. Use the full URL that has the .gif file extension (e.g. "https://media.giphy.com/media/3o6ozBUuLfzTCngAFi/giphy.gif").

Tips for Getting Started

  • To start, you'll want to set up all your backend folders and files (think: db folder, index.js file, etc.).
  • You'll also want to run npm init to create a package.json file to manage dependencies (e.g. express).
  • Set up routes in a controller.
  • Once you have your back end running on http://localhost:3000/gifs, open index.html on the front end to test your routes via the frontend buttons.

You shouldn't need to edit the front-end code. After testing your backend and frontend together, you may have to modify and fix your backend.

Bonus

  • Deploy your backend to Heroku and frontend to GitHub pages.
  • Add tagging functionality.
  • Add another model to the API.

Plagiarism

Take a moment to refamiliarize yourself with the Plagiarism policy. Plagiarized work will not be accepted.

  1. All content is licensed under a CC­BY­NC­SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact legal@ga.co.