A fast API written in go for COS 143 Web Dev
# No need to be inside go path, modules are enabled
git clone git@github.com:y3sh/go143.git
cd go143
# Pull down the libs
go get -u ./...
Compile and run:
go build -o ./bin/go143 .
./bin/go143
Flags include port
and logLevel
(panic, fatal, error, warn, info, debug, trace)
./bind/go143 --port=8080 --logLevel=trace
Test the API at http://localhost:3000/
docker run
-p 6379:6379
-v redisData:/data
--name redis
--restart on-failure
-d redis:6.0.9-alpine redis-server --appendonly yes --requirepass "REDIS_PASSWORD_HERE"
docker build -f Dockerfile -t go143:1.0.0 .
docker run --rm -ti -p 8080:8080 -e REDIS_PASSWORD="REDIS_PASSWORD_HERE" go143:1.0.0 --port=8080 --logLevel=trace
docker stop go143:1.0.0
sudo docker run -d --restart on-failure -p 3000:8080 go143:1.0.0 --port=8080 --logLevel=info
- Install https://github.com/golangci/golangci-lint
- Add your $GOPATH/bin/golangci-lint to your path
- Run
./goLint.sh