Coder Social home page Coder Social logo

backend-organizing-express-code's Introduction

Backend-Organizing-Express-Code

Robust server structure: Organizing Express code Instructions Your task is to extend this API server, which stores "Notes" to enhance the error handling functionality.

It has the folling existing route handlers:

GET /notes returns an array of notes. POST /notes creates a new notes. GET /notes/:noteId returns a single note by ID. Error handler returns status code 500 by default, or the status property of the error. Existing files You will need to reorganize the folders and files located in src/.

Use the existing data files located in src/data for the responses. Feel free to add or remove data from the files as necessary, but keep the same shape of the data.

Tasks You should organize the code to meet the following requirements:

Add the ability to update a note. Add the ability to delete a note. In src/notes/notes.controller.js, define the needed route handlers and middleware functions and export create, read, update, delete, and list for use by the router. In src/notes/notes.router.js, define the router. In src/app.js, attach the notes router using app.use("/notes", notesRouter) and have the error handler return a status code 500 by default, or the status property of the error.

backend-organizing-express-code's People

Contributors

holly-ellington avatar

Watchers

 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.