Giter Club home page Giter Club logo

12-express-middleware's Introduction

cf 12: Express Middleware

Submission Instructions

  • Work in a fork of this repository
  • Work in a branch on your fork
  • Create a PR to your master from your working branch.
  • Ensure that your repository/branch is connected to travis-ci.com
  • Ensure that your repository/branch is connected to a dyno at heroku.com
  • Heroku and Travis should pick you up and deploy
  • Submit on canvas:
    • a question and observation
    • how long you spent
    • link to your pull request
    • link to your build at travis-ci URL
    • Heroku Server URL

Configuration

Configure the root of your repository with the following files and directories. Thoughfully name and organize any aditional configuration or module files.

  • README.md - contains documentation
  • .env - contains env variables (should be git ignored)
  • .gitignore - contains a robust .gitignore file
  • .eslintrc - contains the course linter configuratoin
  • .eslintignore - contains the course linter ignore configuration
  • .travis.yml - contains the course linter ignore configuration
  • package.json - contains npm package config
    • create a lint script for running eslint (eslint **/*.js)
    • create a test script for running tests
    • create a start script for running your server
  • index.js - the entry point for your application
  • src/ - contains your core application files and folders
  • src/app.js - (or main.js) contains your core application bootstrap
  • src/lib/ - contains module definitions
  • __test__/ - contains unit tests

Learning Objectives

  • students will be able to work with application, router, and 3rd party middleware through the use of express.js
  • students will be able to implement custom middleware through the use of express.js
  • students will be able to create custom routers for a specific resource

Feature Tasks

  • create a single resource express API that can handle GET, POST, and PUT requests
  • use the http-errors module to create new errors and associate them with a proper status code
  • create an error-middleware module to handle errors and use it in your server file
  • create a model module to handle dynamic models and use it in your server file
  • create a cors-middleware module that will allow for public use of your API
  • create 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)
  • create the updateNote, fetchNote, and fetchIDs static methods as part of your Note model
  • create a series of note-route-tests to test your GET, POST, and PUT routes
    • hint: you'll want to use the before and after hooks provided by mocha in order to create a test note and delete the note after the test has completed

12-express-middleware's People

Contributors

johncokos avatar

Watchers

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