Skip to content

KnpLabs/gitclicker-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitclicker API

Requirements

  • node >= v15.11.0 (Might work for lower version but not tested)

Install

cp .env.dist .env
yarn install

Run dev

yarn dev

Enpoints

GET /api/shop/items

Response: HTTP 200

[
  {
    "name": "Bash",
    "price": 10,
    "linesPerMillisecond": 0.1
  },
  {
    "name": "Git",
    "price": 100,
    "linesPerMillisecond": 1.2
  },
  {
    "name": "Javascript",
    "price": 10000,
    "linesPerMillisecond": 14
  },
  {
    "name": "React",
    "price": 50000,
    "linesPerMillisecond": 75
  },
  {
    "name": "Vim",
    "price": 1000000,
    "linesPerMillisecond": 10000
  }
]

GET /api/shop/items/:id

Response: HTTP 200

{
  "name": "Bash",
  "price": 10,
  "linesPerMillisecond": 0.1
}

POST /api/shop/items

Body:

{
  "name": "Svelte",
  "price": 40000,
  "linesPerMillisecond": 45.0
}

Response: HTTP 201

{
  "id": 1615820488694,
  "name": "Svelte",
  "price": 40000,
  "linesPerMillisecond": 45.0
}

PUT /api/shop/items/:id

Body:

{
  "name": "Svelte",
  "price": 40000,
  "linesPerMillisecond": 45.0
}

Response: HTTP 200

{
  "id": 1615820488694,
  "name": "Svelte",
  "price": 40000,
  "linesPerMillisecond": 45.0
}

DELETE /api/shop/items/:id

Response: HTTP 204

About

An api for the react-gitclicker training project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published