A cross-platform demo of asp.net core web api.
Install the .NET Core from dot.net, then resolve dependencies and build
$ dotnet restore
$ dotnet build
Install docker and start up postgresql database
$ docker-compose up -d
migrate database using entity framework.
$ dotnet ef database update
Application default listening at http://localhost:5000, i.e API can access by http://localhost:5000/api/products
$ dotnet run
Using docker to deploy, run below commands to resolve dependencies and publish the app
$ dotnet restore
$ dotnet build -c release
$ dotnet publish -c release -o app
$ docker build -t dr:5000/dotnetcore-demo .
start api service, it will start up a container AspNetCoreWebApiApp_WEB
$ docker-compose up -d
test the api
$ curl http://YOUR_SERVER/api/products