A restful API wrapper for the official Hacker News API, written in C#.
Clone this repository, navigate to newly-created root directory on your machine. Also ensure that you have Docker installed on your machine.
From root, run the following command to build local project files:
dotnet clean; dotnet restore --no-cache; dotnet build
From root, run the following commands:
cd .\src\bayonet.Api\
dotnet run
You should now be able to access the running API from http://localhost:5000/swagger
From root, run the following commands to build and run a docker container bayonet-api
from the docker image bayonet
:
docker build -t bayonet .
docker run --rm -p 8080:80 --name bayonet-api bayonet bayonet.Api from Docker
Once the docker commands have executed successfully, run docker ps -a
and you should see the following within your list of running containers:
Finally, you can go ahead and navigate to http://localhost:8080/swagger
, where a list of available APIs should be shown, ready to run. And that's it!
NOTE: If you kill the running bayonet-api
docker container, it will be removed from your container registry per the --rm
tag in the run
command; if you wish to retain the container within your registry, simply omit this tag from the run
command.