Giter VIP home page Giter VIP logo

12-express_middleware's Introduction

CF Lab 12: Single Resource Express API

The build out of this API:

  • Created a HTTP server using express
  • Created an object constructor which then creates a simple resource with three properties
  •   1. id
    
  •   2. author
    
  •   3. entry
    
  • Created a single resource express API that can handle GET, POST, and PUT requests
  • Used the http-errors module to create new errors and associate them with a proper status code
  • Created an error-middleware module to handle errors and use it in your server file
  • Created a cors-middleware module that will allow for public use of your API
  • Created a storage module that stores resources by their schema type
  • Created the deleteItem and availIDs methods and add them to your storage module
    • these methods should be used to delete a resource (deleteItem) and return an array of id's from persisted resource filenames (availIDs)
  • Created a series of note-route-tests to test your GET, POST, and PUT routes

Server Endpoints

'/api/journal'

  • POST Request
  • PUT Request
  • GET Request
  • DELETE Request

Tests

-Wrote tests to ensure the /api/journal endpoint responds as described for each condition below:

12-express_middleware's People

Contributors

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