Giter Site home page Giter Site logo

challange-api's Introduction

Challange BackEnd Api

Environment

Development
// Verify that you've installed Go
$ go version

// Clone the project
$ git clone github.com/aleynaguzell/challange-api
$ cd challange-api

// Run test
$ go test -v ./tests -run Test

// Run project
$ go run main.go

API Document

HealthCheck

  • HealthCheck Endpoint
    API ping endpoint barely checks that the API is running and is accessible.
EXAMPLE URL

Prod:
https://challange-api.herokuapp.com/

Dev:
http://localhost:8080/
EXAMPLE SUCCESS RESPONSE

Code : 200

Body: Ok 

Memory

  • Get Endpoint
    Get data from an in-memory database.
URI
/in-memory
METHOD
GET
EXAMPLE URL
Prod:
https://challange-api.herokuapp.com/in-memory?key=active-tabs

Dev:
http://localhost:8080/in-memory?key=active-tabs

EXAMPLE SUCCESS RESPONSE

Code : 200

Payload:
{
    "key": "active-tabs",
    "value": "getir"
}
  • Set Endpoint
    Set data to an in-memory database.
URI
/in-memory/

METHOD POST


EXAMPLE REQUEST


Payload:
{
  "key": "active-tabs",
  "value": "getir"
}
EXAMPLE URL

Prod:
https://challange-api.herokuapp.com/in-memory/

Dev:
http://localhost:8080/in-memory/
EXAMPLE SUCCESS RESPONSE

Code : 201

Body:
{
 "key": "active-tabs",
 "value": "getir"
}

Record

  • GetRecords Endpoint
    Fetch data from records collection
URI
/records

METHOD
POST

EXAMPLE URL

Prod:
https://challange-api.herokuapp.com/records

Dev:
http://localhost:8080/records


EXAMPLE REQUEST 

Payload:
{
  "startDate": "2016-01-26",
  "endDate": "2018-02-02",
  "minCount": 2700,
  "maxCount": 3000
}
EXAMPLE SUCCESS RESPONSE

Code : 200

Body:
{
  "code":0,
  "msg":"Success",
  "records": [
    {
      "key":"TAKwGc6Jr4i8Z487",
      "createdAt":"2017-01-28T01:22:14.398Z",
      "totalCount":2800
    },
    {
      "key":"NAeQ8eX7e5TEg7oH",
      "createdAt":"2017-01-27T08:19:14.135Z",
      "totalCount":2900
    }
  ]
}

challange-api's People

Contributors

aleynaguzell 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.