https://github.com/knplabs/gitclicker-api
An api for the react-gitclicker training project
https://github.com/knplabs/gitclicker-api
training-material
Last synced: 3 months ago
JSON representation
An api for the react-gitclicker training project
- Host: GitHub
- URL: https://github.com/knplabs/gitclicker-api
- Owner: KnpLabs
- Created: 2021-03-15T10:50:59.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-05-05T08:52:43.000Z (8 months ago)
- Last Synced: 2025-10-06T02:25:20.122Z (3 months ago)
- Topics: training-material
- Language: TypeScript
- Homepage:
- Size: 107 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gitclicker API
## Requirements
- `node >= v15.11.0` (Might work for lower version but not tested)
## Install
```bash
cp .env.dist .env
yarn install
```
## Run dev
```bash
yarn dev
```
## Enpoints
### `GET /api/shop/items`
Response: HTTP 200
```json
[
{
"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
```json
{
"name": "Bash",
"price": 10,
"linesPerMillisecond": 0.1
}
```
### `POST /api/shop/items`
Body:
```json
{
"name": "Svelte",
"price": 40000,
"linesPerMillisecond": 45.0
}
```
Response: HTTP 201
```json
{
"id": 1615820488694,
"name": "Svelte",
"price": 40000,
"linesPerMillisecond": 45.0
}
```
### `PUT /api/shop/items/:id`
Body:
```json
{
"name": "Svelte",
"price": 40000,
"linesPerMillisecond": 45.0
}
```
Response: HTTP 200
```json
{
"id": 1615820488694,
"name": "Svelte",
"price": 40000,
"linesPerMillisecond": 45.0
}
```
### `DELETE /api/shop/items/:id`
Response: HTTP 204