Files
ResourceUsageAPI/start-service.bat

42 lines
1.0 KiB
Batchfile

@echo off
REM Resource Monitor Service - Quick Start Script
echo Starting Resource Monitor Service v2.0...
echo.
echo This service will monitor your VM's resources and provide a REST API
echo for remote monitoring from your Unraid server.
echo.
echo Service will be available at: http://localhost:24142
echo API Documentation: http://localhost:24142/api/health
echo.
echo Press Ctrl+C to stop the service
echo.
REM Change to the script's directory
cd /d "%~dp0"
REM Check if .NET 9 is installed
dotnet --version > nul 2>&1
if errorlevel 1 (
echo ERROR: .NET 9.0 Runtime is required but not found.
echo Please install .NET 9.0 Runtime from: https://dotnet.microsoft.com/download
pause
exit /b 1
)
REM Build and run the service
echo Building service...
dotnet build --configuration Release
if errorlevel 1 (
echo ERROR: Build failed. Please check the error messages above.
pause
exit /b 1
)
echo.
echo Starting service on http://localhost:24142
echo.
dotnet run --configuration Release
pause