Skip to content

Latest commit

 

History

History
102 lines (73 loc) · 2.27 KB

README.md

File metadata and controls

102 lines (73 loc) · 2.27 KB

KMA Score API

KMA Score API written in Go

Installation

There are three ways you can use:

1. Compile and run by yourself

  1. Install Golang (1.18.3 or above)

  2. Install MariaDB (10.6.4 or above)

  3. Insert your data into database

  4. Create/Edit enviroment file

# .env

PORT = 8000 # Change port here
  1. Run locally
go run main.go
  • Or you can build
go build -o /kma-score-api

2. Using our Docker image

  1. Pull and run Meilisearch docker image
  2. Pull Docker image
docker pull arahiko/kma-score-api:latest
  1. Run
docker run -p 8080:8080 --name kma_score \
-e PORT=8080 DB_USERNAME=username DB_PASSWORD=password \
DB_NAME=database_name DB_HOST=localhost DB_PORT=3306 \
MEILISEARCH_HOST=your-host MEILISEARCH_PORT=7700 \
MEILISEARCH_API_KEY=meilisearch_api_key \
arahiko/kma-score-api:lastest
  • Or you can use your env file when run docker container
docker run -p 8080:8080 --name kma_score --env-file path/to/.env arahiko/kma-score-api:latest 

3. Using our docker-compose file

docker-compose -f docker-compose.yml up -d

API Reference

Get all scores by student code

GET /student/{StudentId}
Parameter Type Description
StudentId string Required

Get all subject

GET /subjects

Edit score in database

POST /add-score/{StudentId}
Parameter Type Description
StudentId string Required

Search students

GET /student/?query={query}
Parameter Type Description
query string Required