A go microservice that can enables us to create, modify, fetch, and delete users
$ go run main.go serve
$ go test ./...
$ go run main.go serve --env STAGE --host 0.0.0.0 --port 4000
$ make dep # install dependencies
$ make test # run unit tests
$ make cover # run code coverage report service (http://localhost:3001)
$ make run # run the service
$ make build # compile standalone binary for docker container
$ make image # build docker image
Endpoint: http://localhost:3000/api/v1/users
HTTP Header: Content-Type : application/json
HTTP Request Body
{
"username": "[email protected]",
"firstname": "Elon",
"lastname": "Musk"
}
201 Created, HTTP Response Body:
{
"userName": "[email protected]",
"firstName": "Elon",
"lastName": "Musk",
"dateCreated": "2022-01-01T04:03:06+05:30",
"dateModified": "2022-01-01T04:03:06+05:30"
}
Endpoint: http://localhost:3000/api/v1/users/[email protected]
200 Ok, HTTP Response Body :
{
"userName": "[email protected]",
"firstName": "Elon",
"lastName": "Musk",
"dateCreated": "2022-01-01T04:03:06+05:30",
"dateModified": "2022-01-01T04:03:06+05:30"
}
- We'll all Swagger documentation for all the APIs.
- Currently we are hard deleting the user, we'll modify to soft delete a user.
- Add the functionality to rent and sale properties