Coder Social home page Coder Social logo

diy-api-mongoose's Introduction

DIY API โ€” Homework

Deliverable:

For our first MERN app mini project you will be building a personal blog (longterm feel free to use this for outcomes!). First, it's time to make your own API!

Using what you have learned about Express, Express Routing, RESTful routing, CRUD operations, and Mongoose, use the Mongoose ODM to implement full CRUD functionality on a model (subject of your choosing).

What is a MERN App?

MERN is an acronym for an app that utilizes Mongo/Mongoose and Express for the backend (typically an API layer), and React/Node for the frontend.

How we make it work:

  • we will build an express server that makes mongoose CRUD requests to a Mongo db.
  • we will build a React frontend that will make calls to our express API for any data.

Requirements:

  1. The model you choose to use should have at least three fields, in addation to the default _id field.

Example:

column name type
_id integer
name string
title integer
content string
  1. Your API should be accessible via five routes:

Example:

Method Action URL Functionality
GET index /blog list all blog posts
POST create /blog add a new blog post
GET detail/show /blog/:id show one blog post
PUT update /blog/:id update one blog post
DELETE delete /blog/:id delete one blog post

Steps to Achieve

You will need to:

  1. Fork and clone this repository!
  2. Run npm init to start your node project.
  3. Create a .gitignore and add everything to ignore
  4. Create your Express App
  5. Add Mongoose functionality!

Recommended Workflow:

  1. Stub out your routes. For the purposes of initial declaration, res.send("test") to make sure you're hitting them.
  2. Link your model to your server.
  3. Update your routes to "do something" and make the magic happen!

diy-api-mongoose's People

Contributors

miknayr avatar 009kings avatar azocher avatar nickubed 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.