Skip to content

user-microservice is a set of API written in GO to manage user

License

Notifications You must be signed in to change notification settings

thomaspoignant/user-microservice

Repository files navigation

USER microservice

Build Status Coverage Status FOSSA Status

user-microservice is a set of API to manage users.
This project is written in GO, it store data in dynamodb.

Start the project

You can build the project by using the command

make build

After that you can run the project by using (please configure you own env variables) :

export GIN_MODE: debug \
    && export APP_PORT: 8080 \
    && export RUNNING_MODE: api \
    && export DYNAMODB_ENDPOINT:http://localhost:9000 \
    && export AWS_REGION: eu-west-1 \
    && export DYNAMODB_TABLE_NAME: user \
    && ./user-microservice

If you want to use a local dynamodb

Run dynamodb-local on docker

docker run -d -p 9000:8000 amazon/dynamodb-local

Create a dynamodb table (you need AWS cli)

aws dynamodb create-table --table-name user \
    --attribute-definitions \
        AttributeName=id,AttributeType=S \
    --key-schema AttributeName=id,KeyType=HASH \
    --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1 \
    --endpoint-url http://localhost:9000

Use swagger

Swagger is configure in the app you can access to the APIs to the URL : http://localhost:8080/swagger/index.html