Commit all scripts
This commit is contained in:
16
colaflow-api/test-api-quick.ps1
Normal file
16
colaflow-api/test-api-quick.ps1
Normal file
@@ -0,0 +1,16 @@
|
||||
try {
|
||||
$response = Invoke-WebRequest -Uri 'http://localhost:5167/api/auth/me' `
|
||||
-Method Get -UseBasicParsing -ErrorAction Stop
|
||||
Write-Host "API Status: $($response.StatusCode)" -ForegroundColor Green
|
||||
Write-Host "API is responding!" -ForegroundColor Green
|
||||
exit 0
|
||||
} catch {
|
||||
if ($_.Exception.Response.StatusCode.value__ -eq 401) {
|
||||
Write-Host "API Status: 401 (Unauthorized - expected)" -ForegroundColor Green
|
||||
Write-Host "API is responding!" -ForegroundColor Green
|
||||
exit 0
|
||||
} else {
|
||||
Write-Host "API Error: $($_.Exception.Message)" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user