GoScrobble/README.md

28 lines
809 B
Markdown
Raw Normal View History

2021-03-23 06:07:39 +00:00
# go-scrobble
2021-03-23 08:43:44 +00:00
Golang based music scrobbler. MySQL backend.
## Setup MySQL
create user 'goscrobble'@'%' identified by 'supersecurepass';
create database goscrobble;
grant all privileges on goscrobble.* to 'goscrobble'@'%';
## Local build/run
2021-03-24 03:29:35 +00:00
cd web && npm install && npm start
# In another terminal
2021-03-23 08:43:44 +00:00
go mod tidy
CGO_ENABLED=0 MYSQL_HOST=127.0.0.1 MYSQL_USER=goscrobble MYSQL_PASS=supersecurepass MYSQL_DB=goscrobble go run cmd/go-scrobble/*.go
2021-03-24 03:29:35 +00:00
Access test frontend through http://127.0.0.1:3000 API http://127.0.0.1:42069/api/v1
2021-03-23 08:43:44 +00:00
## Run local tests
2021-03-24 03:29:35 +00:00
go test test/*
## Prod deployment
We need to build NPM package, and then ship web/build with the binary.
cd web npm install --production && npm run build
go build -o goscrobble cmd/go-scrobble/*.go
./goscrobble