Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ea2fe47263 | |||
| 294438145a | |||
| 413360ece2 | |||
| a0b9f05ae3 | |||
| caa7436d51 | |||
| 5eec358b68 | |||
| 7c1cbb44f8 | |||
| 06ea991a6c | |||
| 156ae148a7 |
@@ -9,6 +9,15 @@ public static class NvmlWrapper
|
|||||||
[DllImport("nvml.dll", EntryPoint = "nvmlShutdown")]
|
[DllImport("nvml.dll", EntryPoint = "nvmlShutdown")]
|
||||||
public static extern int NvmlShutdown();
|
public static extern int NvmlShutdown();
|
||||||
|
|
||||||
|
// Get device count
|
||||||
|
/* [DllImport("nvml.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
private static extern int nvmlDeviceGetCount_v2(ref uint deviceCount); */
|
||||||
|
|
||||||
|
/* public static int NvmlDeviceGetCount(ref uint deviceCount)
|
||||||
|
{
|
||||||
|
return nvmlDeviceGetCount_v2(ref deviceCount);
|
||||||
|
} */
|
||||||
|
|
||||||
[DllImport("nvml.dll", EntryPoint = "nvmlDeviceGetHandleByIndex_v2")]
|
[DllImport("nvml.dll", EntryPoint = "nvmlDeviceGetHandleByIndex_v2")]
|
||||||
public static extern int NvmlDeviceGetHandleByIndex(int index, out IntPtr device);
|
public static extern int NvmlDeviceGetHandleByIndex(int index, out IntPtr device);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,119 @@
|
|||||||
# dotnet
|
# Resource Usage API
|
||||||
|
|
||||||
|
This project is a background service developed using ASP.NET Core that monitors system resource usage, such as CPU, RAM, GPU, and running games. The service provides APIs to fetch the current resource usage and kill specified processes.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- **Resource Monitoring**: Fetches detailed information about the system's resources, including:
|
||||||
|
- Current Time
|
||||||
|
- Computer Information (Machine Name, OS Version, Architecture, Processor Count)
|
||||||
|
- CPU Usage
|
||||||
|
- RAM Usage
|
||||||
|
- GPU Usage
|
||||||
|
- Currently Running Steam Games (if any)
|
||||||
|
|
||||||
|
- **Process Management**: Provides an API to kill processes by their process ID.
|
||||||
|
|
||||||
|
## Directory Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
ResourceUsageAPI/
|
||||||
|
├── Worker.cs
|
||||||
|
├── Program.cs
|
||||||
|
├── Startup.cs
|
||||||
|
└── NvmlWrapper.cs
|
||||||
|
```
|
||||||
|
|
||||||
|
## Code Analysis
|
||||||
|
|
||||||
|
### Worker.cs
|
||||||
|
|
||||||
|
This file contains the main logic for monitoring system resources and exposing APIs.
|
||||||
|
|
||||||
|
- **Dependencies**: Uses `System.Diagnostics`, `Microsoft.AspNetCore.Builder`, `Newtonsoft.Json` among others.
|
||||||
|
- **Methods**:
|
||||||
|
- `ExecuteAsync`: Sets up the ASP.NET Core web application, defines routes for resource usage and process management, and runs the server.
|
||||||
|
- `GetComputerInfo`: Retrieves basic system information.
|
||||||
|
- `GetCpuUsage`: Fetches CPU usage and lists top three processes by CPU usage if usage is over 80%.
|
||||||
|
- `GetRamUsage`: Calculates RAM usage percentage.
|
||||||
|
- `GetTotalPhysicalMemory`: Retrieves total physical memory size.
|
||||||
|
- `GetGpuUsage`: Uses NVIDIA Management Library (NVML) to fetch GPU usage, temperature, and fan speed.
|
||||||
|
- `GetCurrentlyRunningGame`: Detects if a Steam game is running by checking process paths.
|
||||||
|
- `GetCurrentTime`: Returns the current time.
|
||||||
|
|
||||||
|
### Program.cs
|
||||||
|
|
||||||
|
This file sets up the hosting environment for the application.
|
||||||
|
|
||||||
|
- **Dependencies**: Uses `Microsoft.Extensions.DependencyInjection` and `Microsoft.Extensions.Hosting`.
|
||||||
|
- **Methods**:
|
||||||
|
- `Main`: Entry point of the application, builds and runs the host.
|
||||||
|
- `CreateHostBuilder`: Configures services and determines if the application should run as a Windows service based on command-line arguments or environment variables.
|
||||||
|
|
||||||
|
### Startup.cs
|
||||||
|
|
||||||
|
This file is not used in the current implementation since all routing and configuration are done within `Worker.cs`.
|
||||||
|
|
||||||
|
- **Dependencies**: Uses `Microsoft.AspNetCore.Builder` and `Microsoft.AspNetCore.Hosting`.
|
||||||
|
- **Methods**:
|
||||||
|
- `ConfigureServices`: Placeholder method for adding services.
|
||||||
|
- `Configure`: Placeholder method for configuring application HTTP requests pipeline.
|
||||||
|
|
||||||
|
### NvmlWrapper.cs
|
||||||
|
|
||||||
|
This file provides a C# wrapper for the NVIDIA Management Library (NVML) functions.
|
||||||
|
|
||||||
|
- **Dependencies**: Uses `System` and `System.Runtime.InteropServices`.
|
||||||
|
- **Methods**:
|
||||||
|
- Importing NVML DLL functions to interact with GPU hardware.
|
||||||
|
- Structures like `NvmlUtilization` are defined for handling utilization rates returned by NVML.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
1. **Build the Project**: Use your preferred .NET build tool (e.g., `dotnet build`) to compile the project.
|
||||||
|
2. **Run the Application**:
|
||||||
|
- To run as a console application, execute the compiled binary directly.
|
||||||
|
- To run as a Windows service, use the command-line argument `--windows-service` or set the environment variable `RUN_AS_SERVICE` to `"true"`.
|
||||||
|
|
||||||
|
## APIs
|
||||||
|
|
||||||
|
- **Get Resource Usage**:
|
||||||
|
- URL: `/api/resource-usage`
|
||||||
|
- Method: GET
|
||||||
|
- Description: Retrieves current system resource usage.
|
||||||
|
|
||||||
|
- **Kill Process**:
|
||||||
|
- URL: `/api/kill-process`
|
||||||
|
- Method: POST
|
||||||
|
- Body: JSON with the process ID (`{"id": "1234"}`)
|
||||||
|
- Description: Kills the specified process.
|
||||||
|
|
||||||
|
## Important Notes
|
||||||
|
|
||||||
|
- Ensure that the NVIDIA Management Library (NVML) is installed on the system for GPU monitoring to work.
|
||||||
|
- The application allows CORS from all origins, which should be configured securely in production environments.
|
||||||
|
- Error handling and logging are minimal; consider adding robust error handling and logging mechanisms for a production-ready solution.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Feel free to contribute by opening issues or submitting pull requests. Make sure to follow the project's coding style and best practices.
|
||||||
|
|
||||||
|
|
||||||
|
# devnote
|
||||||
dotnet run
|
dotnet run
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Add steam running games"
|
git commit -m "Add steam running games"
|
||||||
git push origin master
|
git push origin master
|
||||||
dotnet publish -c Release -o ./publish
|
dotnet publish -c Release -o ./publish
|
||||||
|
|
||||||
|
# devtest
|
||||||
|
Invoke-WebRequest -Uri "http://localhost:5000/api/kill-process" -Method POST -Body "1234" -Headers @{ "X-API-KEY" = "b7f3e8a1-4c2d-4d9f-9a6e-2a1c5d7f8e9a" }
|
||||||
|
|
||||||
|
Invoke-WebRequest -Uri "http://192.168.50.52:5000/api/resource-usage" -Method GET -Headers @{ "X-API-KEY" = "b7f3e8a1-4c2d-4d9f-9a6e-2a1c5d7f8e9a" }
|
||||||
|
|
||||||
|
Use 'shutdown', 'restart', or 'cancel'.
|
||||||
|
Invoke-WebRequest -Uri "http://192.168.50.52:5000/api/force-shutdown" `
|
||||||
|
-Method POST `
|
||||||
|
-Headers @{ "X-API-KEY" = "b7f3e8a1-4c2d-4d9f-9a6e-2a1c5d7f8e9a" } `
|
||||||
|
-Body '{"Action": "shutdown", "DelaySeconds": 120}' `
|
||||||
|
-ContentType "application/json"
|
||||||
|
|||||||
@@ -25,12 +25,35 @@ namespace ResourceMonitorService
|
|||||||
builder.Services.AddCors(options =>
|
builder.Services.AddCors(options =>
|
||||||
{
|
{
|
||||||
options.AddPolicy("AllowAllOrigins",
|
options.AddPolicy("AllowAllOrigins",
|
||||||
builder => builder.AllowAnyOrigin()
|
builder => builder
|
||||||
|
.WithOrigins("http://localhost:4200","http://192.168.50.52:4200","http://vmwin11:4200")
|
||||||
.AllowAnyHeader()
|
.AllowAnyHeader()
|
||||||
.AllowAnyMethod());
|
.AllowAnyMethod());
|
||||||
});
|
});
|
||||||
builder.Services.AddControllers().AddNewtonsoftJson();
|
builder.Services.AddControllers().AddNewtonsoftJson();
|
||||||
|
|
||||||
|
// Read the API key from appsettings.json
|
||||||
|
var configuration = builder.Configuration;
|
||||||
|
var apiKey = configuration["ApiSettings:ApiKey"];
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
// Middleware to validate API key
|
||||||
|
// This middleware checks for the presence of the API key in the request headers
|
||||||
|
// and compares it with the expected API key from appsettings.json.
|
||||||
|
// If the API key is missing or invalid, it returns a 401 Unauthorized response.
|
||||||
|
//
|
||||||
|
/* app.Use(async (context, next) =>
|
||||||
|
{
|
||||||
|
if (!context.Request.Headers.TryGetValue("X-API-KEY", out var extractedApiKey) || extractedApiKey != apiKey)
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = StatusCodes.Status401Unauthorized;
|
||||||
|
await context.Response.WriteAsync("Unauthorized: Invalid API Key");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await next();
|
||||||
|
}); */
|
||||||
// Apply CORS policy to allow all origins
|
// Apply CORS policy to allow all origins
|
||||||
app.UseCors("AllowAllOrigins");
|
app.UseCors("AllowAllOrigins");
|
||||||
|
|
||||||
@@ -59,6 +82,123 @@ namespace ResourceMonitorService
|
|||||||
await context.Response.WriteAsync(json);
|
await context.Response.WriteAsync(json);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.MapPost("/api/kill-process", async context =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var idStr = await new StreamReader(context.Request.Body).ReadToEndAsync();
|
||||||
|
int processId = Convert.ToInt32(idStr);
|
||||||
|
|
||||||
|
Process[] processes = Process.GetProcesses().Where(p => p.Id == processId).ToArray();
|
||||||
|
|
||||||
|
if (processes.Length > 0)
|
||||||
|
{
|
||||||
|
foreach (var process in processes)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
process.Kill();
|
||||||
|
await context.Response.WriteAsync($"Process with ID {processId} has been killed.");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
await context.Response.WriteAsync($"Error killing process with ID {processId}: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await context.Response.WriteAsync($"No process found with ID {processId}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
await context.Response.WriteAsync($"An error occurred: {ex.Message}");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/* curl -X POST http://localhost:5000/api/force-shutdown -d "5000" */
|
||||||
|
/* Invoke-WebRequest -Uri "http://localhost:5000/api/force-shutdown" -Method POST -Body "50000" -ContentType "text/plain" */
|
||||||
|
app.MapPost("/api/force-shutdown", async context =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var requestBody = await new StreamReader(context.Request.Body).ReadToEndAsync();
|
||||||
|
var parameters = JsonConvert.DeserializeObject<dynamic>(requestBody);
|
||||||
|
|
||||||
|
string action = parameters?.Action?.ToString()?.ToLower(); // "shutdown" or "restart"
|
||||||
|
int delaySeconds = parameters?.DelaySeconds ?? 0;
|
||||||
|
|
||||||
|
// Validate action input
|
||||||
|
if (action != "shutdown" && action != "restart" && action != "cancel")
|
||||||
|
{
|
||||||
|
await context.Response.WriteAsync("Invalid action. Use 'shutdown', 'restart', or 'cancel'.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//if action is stop, then cancel the shutdown
|
||||||
|
if (action == "cancel")
|
||||||
|
{
|
||||||
|
var processStartInfoCancel = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = "shutdown",
|
||||||
|
Arguments = "/a",
|
||||||
|
CreateNoWindow = true,
|
||||||
|
UseShellExecute = false
|
||||||
|
};
|
||||||
|
|
||||||
|
Process.Start(processStartInfoCancel);
|
||||||
|
await context.Response.WriteAsync("Shutdown cancelled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate delay input
|
||||||
|
if (delaySeconds < 0)
|
||||||
|
{
|
||||||
|
await context.Response.WriteAsync("Delay must be a non-negative integer.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine the shutdown command
|
||||||
|
string shutdownCommand = action == "shutdown" ? $"/s /f /t {delaySeconds}" : $"/r /f /t {delaySeconds}";
|
||||||
|
|
||||||
|
var processStartInfo = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = "shutdown",
|
||||||
|
Arguments = shutdownCommand,
|
||||||
|
CreateNoWindow = true,
|
||||||
|
UseShellExecute = false
|
||||||
|
};
|
||||||
|
|
||||||
|
Process.Start(processStartInfo);
|
||||||
|
|
||||||
|
await context.Response.WriteAsync($"{action.ToUpper()} command executed with a delay of {delaySeconds} seconds.");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
await context.Response.WriteAsync($"An error occurred: {ex.Message}");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.MapGet("/api/stop", async context =>
|
||||||
|
{
|
||||||
|
await context.Response.WriteAsync("Stopping the service...");
|
||||||
|
_lifetime.StopApplication();
|
||||||
|
});
|
||||||
|
|
||||||
|
app.MapGet("/", () => "Resource Monitor Service is running.");
|
||||||
|
app.MapGet("/api/current-time", () => Results.Ok(GetCurrentTime()));
|
||||||
|
app.MapGet("/api/computer-info", () => Results.Ok(GetComputerInfo()));
|
||||||
|
app.MapGet("/api/cpu-usage", () => Results.Ok(GetCpuUsage()));
|
||||||
|
app.MapGet("/api/ram-usage", () => Results.Ok(GetRamUsage()));
|
||||||
|
app.MapGet("/api/gpu-usage", () => Results.Ok(GetGpuUsage()));
|
||||||
|
app.MapGet("/api/running-game", () => Results.Ok(GetCurrentlyRunningGame()));
|
||||||
|
app.MapGet("/api/total-physical-memory", () => Results.Ok(GetTotalPhysicalMemory()));
|
||||||
|
app.MapGet("/api/total-available-memory", () => Results.Ok(new { TotalAvailableMemory = Environment.WorkingSet }));
|
||||||
|
|
||||||
|
app.MapGet("/health", () => Results.Ok("Service is healthy."));
|
||||||
|
|
||||||
|
|
||||||
_ = app.RunAsync(stoppingToken);
|
_ = app.RunAsync(stoppingToken);
|
||||||
|
|
||||||
await Task.Delay(Timeout.Infinite, stoppingToken);
|
await Task.Delay(Timeout.Infinite, stoppingToken);
|
||||||
@@ -91,7 +231,26 @@ namespace ResourceMonitorService
|
|||||||
if (usage > 80)
|
if (usage > 80)
|
||||||
{
|
{
|
||||||
// Get the current processes and sort them by CPU usage in descending order
|
// Get the current processes and sort them by CPU usage in descending order
|
||||||
var processes = Process.GetProcesses().OrderByDescending(p => p.TotalProcessorTime);
|
var processes = Process.GetProcesses()
|
||||||
|
.Select(p =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Process = p,
|
||||||
|
TotalProcessorTime = p.TotalProcessorTime
|
||||||
|
};
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null; // Skip processes that throw exceptions
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.Where(p => p != null)
|
||||||
|
.OrderByDescending(p => p.TotalProcessorTime)
|
||||||
|
.Select(p => p.Process)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
// Create a new anonymous type containing the CPU usage, RAM usage, and the top 3 highest CPU-using processes
|
// Create a new anonymous type containing the CPU usage, RAM usage, and the top 3 highest CPU-using processes
|
||||||
return new
|
return new
|
||||||
@@ -155,6 +314,21 @@ namespace ResourceMonitorService
|
|||||||
|
|
||||||
private object GetGpuUsage()
|
private object GetGpuUsage()
|
||||||
{
|
{
|
||||||
|
/* if (!IsNvidiaGpuPresent())
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Usage = 0,
|
||||||
|
Temperature = 0,
|
||||||
|
FanSpeed = 0,
|
||||||
|
IsAvailable = false,
|
||||||
|
Message = "No NVIDIA GPU detected"
|
||||||
|
};
|
||||||
|
} */
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
NvmlWrapper.NvmlInit();
|
NvmlWrapper.NvmlInit();
|
||||||
IntPtr device;
|
IntPtr device;
|
||||||
NvmlWrapper.NvmlDeviceGetHandleByIndex(0, out device);
|
NvmlWrapper.NvmlDeviceGetHandleByIndex(0, out device);
|
||||||
@@ -173,9 +347,53 @@ namespace ResourceMonitorService
|
|||||||
{
|
{
|
||||||
Usage = utilization.Gpu,
|
Usage = utilization.Gpu,
|
||||||
Temperature = temperature,
|
Temperature = temperature,
|
||||||
FanSpeed = fanSpeed
|
FanSpeed = fanSpeed,
|
||||||
|
IsAvailable = false,
|
||||||
|
Error = ""
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Usage = 0,
|
||||||
|
Temperature = 0,
|
||||||
|
FanSpeed = 0,
|
||||||
|
IsAvailable = false,
|
||||||
|
Error = ex.Message
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* private bool IsNvidiaGpuPresent()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Method 1: Try to initialize NVML
|
||||||
|
NvmlWrapper.NvmlInit();
|
||||||
|
uint deviceCount = 0;
|
||||||
|
NvmlWrapper.NvmlDeviceGetCount(ref deviceCount);
|
||||||
|
NvmlWrapper.NvmlShutdown();
|
||||||
|
|
||||||
|
return deviceCount > 0;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// Method 2: Fallback to checking using WMI
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController WHERE Name LIKE '%NVIDIA%'"))
|
||||||
|
{
|
||||||
|
var collection = searcher.Get();
|
||||||
|
return collection.Count > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} */
|
||||||
|
|
||||||
private object GetCurrentlyRunningGame()
|
private object GetCurrentlyRunningGame()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,5 +12,8 @@
|
|||||||
"Url": "http://*:5000"
|
"Url": "http://*:5000"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"ApiSettings": {
|
||||||
|
"ApiKey": "b7f3e8a1-4c2d-4d9f-9a6e-2a1c5d7f8e9a"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# PowerShell script to create a new inbound rule in Windows Firewall
|
# PowerShell script to create a new inbound rule in Windows Firewall
|
||||||
$port = 5000
|
$port = 5000
|
||||||
$ruleName = "ResourceMonitorService"
|
$ruleName = "ResourceMonitorServicePublish"
|
||||||
if (Get-NetFirewallRule -DisplayName $ruleName) {
|
if (Get-NetFirewallRule -DisplayName $ruleName) {
|
||||||
Write-Host "Rule already exists, not creating a new one"
|
Write-Host "Rule already exists, not creating a new one"
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
sc create ResourceMonitorServicerrr binPath= "%~dp0ResourceMonitorService.exe --windows-service" start= auto
|
sc create ResourceMonitorService binPath="%~dp0ResourceMonitorService.exe --windows-service" start= auto
|
||||||
sc description ResourceMonitorServicerrr "A service that monitors system resource usage and exposes it via a web API."
|
sc description ResourceMonitorService "A service that monitors system resource usage and exposes it via a web API."
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"RunAsWindowsService": true,
|
||||||
|
"Kestrel": {
|
||||||
|
"Endpoints": {
|
||||||
|
"Http": {
|
||||||
|
"Url": "http://*:5000"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ApiSettings": {
|
||||||
|
"ApiKey": "b7f3e8a1-4c2d-4d9f-9a6e-2a1c5d7f8e9a"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"RunAsWindowsService": true,
|
||||||
|
"Kestrel": {
|
||||||
|
"Endpoints": {
|
||||||
|
"Http": {
|
||||||
|
"Url": "http://*:5000"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ApiSettings": {
|
||||||
|
"ApiKey": "b7f3e8a1-4c2d-4d9f-9a6e-2a1c5d7f8e9a"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"RunAsWindowsService": true,
|
||||||
|
"Kestrel": {
|
||||||
|
"Endpoints": {
|
||||||
|
"Http": {
|
||||||
|
"Url": "http://*:5000"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ApiSettings": {
|
||||||
|
"ApiKey": "b7f3e8a1-4c2d-4d9f-9a6e-2a1c5d7f8e9a"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user