.NET WebAPI Project (traditional REST)
Create the Service
https://github.com/jfcarr/dotnet-iot-tui/tree/main/src/SenseHatProvider
Steps:
- Create the project, using
webapi
as the project type. - Add a project reference to
SenseHatLib.csproj
- Add .NET IoT bindings.
- Configure the project for remote access (in
launchsettings.json
) - Configure RESTful access to sensor data.
Service Startup
Open a terminal in the project directory and run:
dotnet run
If you want to start the service and leave it running in the background, add an ampersand to your command:
dotnet run &
Test with Swagger
Access the service Swagger page at http://<service ip>:<service port>/swagger
.