Skip to content

soup-bowl/api.whatsth.is

Repository files navigation

What's This? API

CodeFactor Gitpod

⚠️ in active development, thar be dragons!

Counterpart backend API for the whatsth.is project. It currently has the following functions

Want to quickstart? With Docker/Podman installed, Run:

docker run -p 80:80 ghcr.io/soup-bowl/whatsthis-api:latest

This API has Swagger documentation on the homepage.

Overrides

You can over-ride the default API settings using environmental variables.

Environmental Key Default Purpose
REDIS_URL None Caching & storage agent.
WTAPI_DEFINITION_URL Latest definitions Can provide a different YAML or JSON source for the detection definitions.

Starting up

Use Kestrel to run the server. This is achieved by running the following (post depedency installation - see below):

dotnet run --project Whatsthis.API

By default, the server will be available at http://localhost:43594.

Docker

Run docker-compose up --build to start the server locally (runs on port 43594).

Native

This project uses NuGet to manage dependencies.

dotnet dev-certs https 
dotnet restore
dotnet build
dotnet run --project Whatsthis.API

This project uses xUnit for tests, and can be run by executing:

dotnet test