Skip to content
/ UserInfo Public

Small project in C#: Expose an API with a few endpoints to track some user info and retrieve it

Notifications You must be signed in to change notification settings

B3tty/UserInfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Info API

This API was developed primarily for an interview process. The corresponding instructions can be found here. I also wrote some specifications

Running the app on your computer

The cached version is the one chosen from production because of Heroku deployment, but the Cassandra version would be a better choice for a real production environment.

With the .NET Core SDK

Download and install the .NET Core SDK from .NET Downloads.

Cached Version

$ export ASPNETCORE_ENVIRONMENT=Production
$ dotnet run --project src/UserInfo.Api/UserInfo.Api.csproj

Simple Cassandra version

$ docker run -p 9042:9042 --name mk-cassandra -d cassandra:latest
$ export ASPNETCORE_ENVIRONMENT=local
$ dotnet run --project src/UserInfo.Api/UserInfo.Api.csproj

With Docker

Cached version

$ docker build -t mk .
$ docker run --rm -it -p 5000:5000 -e ASPNETCORE_ENVIRONMENT="Production" mk

Simple Cassandra version

$ docker run -p 9042:9042 --name mk-cassandra -d cassandra:latest
$ docker build -t mk .
$ docker run --rm -it -d -p 5000:5000 -e ASPNETCORE_ENVIRONMENT="docker" --link mk-cassandra:cassandra mk

Deploy on Heroku

Install Docker

docker build -t mk .

# Be sure to have a heroku account, that the app is created there, and that you have Heroku CLI installed.
# 'mk-bettym' is the name of the heroku app

heroku login
heroku container:login
docker tag mk registry.heroku.com/mk-bettym/web
heroku container:push web -a mk-bettym
# OR docker push registry.heroku.com/mk-bettym/web
heroku container:release web -a mk-bettym

Re-Release quickly:

docker build -t mk .
heroku container:push web -a mk-bettym
heroku container:release web -a mk-bettym

Accessing the API

About

Small project in C#: Expose an API with a few endpoints to track some user info and retrieve it

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published