Sign inSign up

arahiko/kma-score-api

By arahiko

•Updated over 3 years ago

KMA Score API written in Go

Image
1

462

arahiko/kma-score-api repository overview

⁠KMA Score API

KMA Score API written in Go

⁠Installation

There are two ways you can use:

⁠1. Compile and run by yourself
  1. Install Golang (1.18.3 or above)⁠

  2. Copy a dump SQLite3 Score Database to folder. Leave it near main.go

    Tip: You can dump it by using KMA Score Extractor⁠

  3. Create/Edit enviroment file

# .env

PORT = 8000 # Change port here
DB_PATH = ./kma_score.db # Path to DB file, default: ./data/kma_score.db
  1. Run locally
go run main.go
  • Or you can build
go build -o /kma-score-api
⁠2. Using our Docker image⁠
  1. Pull Docker image
docker push arahiko/kma-score-api:latest
  1. Run
docker run -p 8080:8080 --name kma_score -v path/to/your/db_folder:/app/data -d arahiko/kma-score-api
  1. Check if the container is running
docker ps
  • After the first time, you can run the container with:
docker run kma_score

⁠API Reference

⁠Get all scores by student code
GET /scores/{studentCode}
ParameterTypeDescription
studentCodestringRequired
⁠Get all subject
GET /subjects
⁠Get Avg score
GET /avg-score/{studentCode}
ParameterTypeDescription
studentCodestringRequired
⁠Edit score in database
POST /add-score/{studentCode}
ParameterTypeDescription
studentCodestringRequired

Tag summary

Content type

Image

Digest

sha256:80717776e…

Size

230.2 MB

Last updated

over 3 years ago

docker pull arahiko/kma-score-api