Run dynamodb locally and create tables
cd dbConn
./run.sh
Run service
cd service
EXPORT AWS_ACCESS_KEY=dzien
EXPORT AWS_SECRET_KEY=donry
EXPORT AWS_REGION=us-west-2
EXPORT HOST=http://localhost:
EXPORT PORT=liczba
EXPORT REGION=us-west-2
EXPORT DYNAMO_PORT=8000
EXPORT ISLOCAL=true/false
go get github.com/aws/aws-sdk-go/aws
go get github.com/aws/aws-sdk-go/service/dynamodb
go get github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute
go get github.com/go-chi/chi
go get github.com/go-chi/chi/middleware
go build
go run main.go
Endpoints:
[GET] localhost:port/links - fetch all links ( for dev purposes ) SUCCESS (200), ERROR (500)
[POST] localhost:port/links - crreate link
Body:
"owner": "1321231",
"original": "http://www.beka.com",
"ttl": 125
} SUCCESS (201), ERROR (500)
[GET] localhost:port/links/{skrot} - give me original url -> redirect ( + register click :) ) SUCCESS (301), ERROR (503)
[GET] localhost:port/api/links/{user} - give me user's links sum of clicks SUCCESS (200), ERROR (500)
[GET] localhost:port/links/heath - healtheck