Giter VIP home page Giter VIP logo

dgm3780restapiassignment's Introduction

REST API Assign Build Status

In this assignment we will be writing a simple REST API. Both GET and POST methods will be used

#Steps

  1. Fork and clone the repo. See the last assign for detailed steps.
  2. Complete the assigned coding tasks
  3. Submit Pull Request

Assignment

For this assignment you will be writing a simple REST API. You will need 3 API routes (URL's) 2 GET routes and 1 POST route. All the routes will return JSON formated data.

Using the express framework you will need the following routes:

###/api A HTTP GET request will return any JSON formated data. Typically this would be a validation message to make sure the user is accessing the API correctly

###/api/data A HTTP GET request should return a JSON object with a data property and some fake data.

A HTTP POST request should return a JSON object with a query property containing the data request.

An example for the HTTP POST request: POST data:

{"data" : "QueryGoesHere" }

The API would return:

{"query" : "QueryGoesHere"}

#Tips

  • As always, npm install ๐Ÿ˜›
  • Use body-parser middleware to retrieve the post data.
  • The body-parser will need to use both bodyParser.json() and bodyParser.urlencoded({extended: true})
  • Use npm start to start the server. This will use a command line tool called nodemon. Nodemon will watch for changes in the project folder and restart the server AUTOMATICALLY when you save a file. ๐Ÿ˜„
  • Use ````npm test``` to run the tests.

dgm3780restapiassignment's People

Contributors

landonconover avatar thortek avatar

Watchers

James Cloos 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.