monotkate / missing-elem-server

Uses Express, given an array it finds the missing element

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing-elem-server

Uses Express, given an array it finds the missing element. Should be CORS compliant.

Getting started

Once the repository has been cloned, run npm install to install all the dependencies. This project uses express and body-parser for the server side code.

Running node server/server.js will run the node express server which is listening on port 8080.

Use an application like Postman to initiate a POST command to the server.

Usage

Expects to receive a JSON object that contains three things:

  • an array of unsorted, consecutive integers with one missing
  • the lower bound of the integers
  • the upper bound of the integers

Example: { "array": [ 2, 1, 5, 6, 4, 7, 3 ], "lowerBound": 1, "upperBound": 8 }

Will return the missing element to the POST request.

Useful links

About

Uses Express, given an array it finds the missing element

License:GNU General Public License v3.0


Languages

Language:JavaScript 80.7%Language:HTML 19.3%