Coder Social home page Coder Social logo

miknayr / express-creatures-crud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wdi-sea/express-creatures-crud

0.0 0.0 0.0 54 KB

adding a prehistoric creatures section to the RESTful-creatures

License: Other

JavaScript 76.81% CSS 0.32% EJS 22.88%

express-creatures-crud's Introduction

GA Logo Express Creatures CRUD

Prereqs:


Overview

For this deliverable, you're going to add a prehistoric creatures section to your dino CRUD REST app.

Each prehistoric creature will have a type and an img_url, and the prehistoric creatures will be stored in a mock database with a .json file.

example prehistoric_creature:

{
  "type":"giant beaver",
  "img_url":"http://www.beringia.com/sites/default/files/Giant-Beaver-banner.jpg"
}

User Stories

  • As a user, I want to see all prehistoric creatures listed at once
  • As a user, I want to see the details and image of prehistoric creature
  • As a user, I want to use a form and add a prehistoric creature
  • As a user, I want to use a form and edit a prehistoric creature
  • As a user, I want to delete a specific prehistoric creature

Study the following RESTful routing table, you will need to implement the following routes and associated views for prehistoric creatures:

HTTP VERB URL pattern Action (CRUD) Description
GET /prehistoric_creatures Index (READ) lists all prehistoric creatures
GET /prehistoric_creatures/new New (READ) shows a form to make a new prehistoric creature
POST /prehistoric_creatures Create (CREATE) creates an prehistoric creature with the POST payload (form) data and redirects
GET /prehistoric_creatures/:id Show (READ) list information about a specific prehistoric creature (i.e. /prehistoric creatures/1)
GET /prehistoric_creatures/edit/:id Edit (READ) shows a form for editing a specific prehistoric creatures (i.e. /prehistoric_creatures/edit/1)
PUT /prehistoric_creatures/:id Update (UPDATE) updates the data for a specific prehistoric_creature (i.e. /prehistoric creatures/1) and redirects
DELETE /prehistoric_creatures/:id Delete (DESTROY) deletes the prehistoric creature with the specified id (i.e. /prehistoric creatures/1) and redirects

Getting Started

Add a prehistoric_creatures.json to your dino CRUD app, this will serve as you mock database model for prehistoric creatures.

[
  {
    "type":"giant beaver",
    "img_url":"http://www.beringia.com/sites/default/files/Giant-Beaver-banner.jpg"
  },
  {
    "type":"mastodon",
    "img_url":"https://cdn-images-1.medium.com/max/1200/1*a2VvYsKGApR-E1SnT5O7yQ.jpeg"
  },
  {
    "type":"saber-toothed salmon",
    "img_url":"https://cottagelife.com/wp-content/uploads/2014/11/Oncorhynchus_rastrosus.jpg"
  },
  {
    "type":"megalonyx",
    "img_url":"https://animalgeography.files.wordpress.com/2018/08/sloth-banner-e1535192925361.jpg?w=584&h=325"
  }
]

Hint: To make a MVC REST API you will need to reorganize your routes into controllers (one controller for dinosaurs and one controller for prehistoric creatures)

Hint: Stub out route backend API routes and test them with postman before you make your views.

Part 2

For part 2 of this deliverable you will need to add views to your app.

Hint: You will need to have two folders inside your views directory, one for dinosaurs and one for prehistoric_creatures. Make sure to change your res.render() statements accordingly!

Bonus

Style Your App with CSS


Licensing

  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 [email protected].

express-creatures-crud's People

Contributors

miknayr avatar weston-bailey 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.