Giter Site home page Giter Site logo

musakacmaz / getir-case Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 81 KB

A RESTful API with a single endpoint that fetches the data in the provided MongoDB collection and return the results in the requested format.

License: Apache License 2.0

JavaScript 100.00%
nodejs express jest mongoose eslint heroku

getir-case's Introduction

getir-case

Overview

A RESTful API with a single endpoint that fetches the data in the provided MongoDB collection and return the results in the requested format.

Requirements

For development, you will need Node.js and a node global package manager.

If the installation was successful, you should be able to run the following command.

$ node --version

v10.15.3

$ npm --version

6.4.1

If you need to update npm, you can make it using npm! Cool right? After running the following command, just open again the command line and be happy.

$ npm install npm -g

Installation

$ git clone https://github.com/musakacmaz/getir-case

$ cd getir-case

$ npm install

Running

$ node index.js

Your app should now be running on localhost:8080.

Basic use

The request payload will include a JSON with 4 fields.

  • “startDate” and “endDate” fields will contain the date in a “YYYY-MM-DD” format.
  • “minCount” and “maxCount” are for filtering the data. Sum of the “count” array in the documents should be between “minCount” and “maxCount”.
  • Sample: { "startDate": "2016-01-26", "endDate": "2018-02-02", "minCount": 2700, "maxCount": 3000 }

API

The one and only endpoint of the API is 'api/search'.

API can be tested on https://powerful-reef-74039.herokuapp.com/api/search

Examples

Run in Postman

Deploying to Heroku

heroku create
git push heroku master
heroku open

Tests

Jest framework has been used in order to running tests.

$ npm run test

Contributors

Musa Kaçmaz

License

Apache License 2.0

getir-case's People

Contributors

musakacmaz avatar

Stargazers

 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.