Coder Social home page Coder Social logo

joke-api's Introduction

TASK

  • Create a node app that implements a set of REST APIs allowing CRUD functionality for an employee resource.

Expected Time

This exercise is expected to take about 4-5 hours total, over the course of 2-3 days.

Submission Instructions

Post your solution to a public repository on Github. Send the repository URL back to the same person who sent you these instructions.

Additional Guidance

Persistent storage is not necessary, just use an in memory object to track employee records.

Use any npm modules you find useful.

Expected Endpoints

POST http://localhost:3000/api/employees

  • Create a new record using a randomly generated value as the unique identifier (i.e. _id field). Validate that the following fields are included in the POST body and have the right type/format as posted below:
    • firstName (String)

    • lastName (String)

    • hireDate (YYYY-MM-DD format must be in the past)

    • role (String) - must be one of the following (case-insensitive):

      • CEO (can only be one of these)
      • VP
      • MANAGER
      • LACKEY
    • In addition to the fields included in the POST body, include two fields in each new record that are populated by different external APIs. For example, a favorite joke and a favorite quote, or a favorite joke and a second favorite joke. As long as the two external APIs are different.

PUT http://localhost:3000/api/employees/:id

  • Replace the record corresponding to :id with the contents of the PUT body

GET http://localhost:3000/api/employees/:id

  • Return the record corresponding to the id parameter

GET http://localhost:3000/api/employees

  • Return all current records

DELETE http://localhost:3000/api/employees/:id

  • delete the record corresponding to the id parameter

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.