SkyMP Master API
Red House SkyMP Master API implementation written on Go. Supports only MongoDB databases. Verification methods are not yet provided.
Build
Prerequisites
- Go for build.
- Docker for use local MongoDB database.
Installing dependencies
go get -d -v ./
Building app
go build -o main ./cmd/app/main.go
Run app without build
go run ./cmd/app/main.go
Configuration
App use environment variables and config file.
All environment variables:
- MONGO_URI - string
- PASSWORD_SALT - string
- JWT_SECRET - string
- PORT - uint16 (0 < port < 65535)
- PRODUCTION - bool
Development
During development, you can use local database instance in docker via:
docker run --name mongodb -d -p 27017:27017 mongo
Tests
Run tests:
go test ./...
Mock generation
Install GoMock:
go install github.com/golang/mock/mockgen@v1.6.0
Generate:
mockgen -source="./internal/service/service.go" -destination="./internal/service/mocks/mock.go"