cliproxy-api / deploy_koyeb.ps1
godzilla865's picture
feat: Add Koyeb deployment script for cliproxy service
e6190f3
Raw
History Blame Contribute Delete
1.21 kB
$headers = @{
"Authorization" = "Bearer iiy3yhuv4yltwuexh7dowhl7fo64b2h4hcm7q4vysrpuktk2tm6srdxfm1bd9a8r"
"Content-Type" = "application/json"
}
$body = @{
"app_id" = "aa2e1df3-77d9-4e7e-8214-b80f44748dac"
"definition" = @{
"name" = "cliproxy-service-final"
"type" = "WEB"
"git" = @{
"repository" = "github.com/Godzilla675/proxy-api-llms"
"branch" = "main"
}
"ports" = @(
@{
"port" = 8317
"protocol" = "http"
}
)
"scalings" = @(
@{
"min" = 1
"max" = 1
}
)
"instance_types" = @(
@{
"type" = "nano"
}
)
"regions" = @("fra")
}
} | ConvertTo-Json -Depth 10
try {
Write-Host "Sending request..."
$response = Invoke-RestMethod -Uri "https://app.koyeb.com/v1/services" -Method Post -Headers $headers -Body $body
Write-Host "Success!"
$response | ConvertTo-Json -Depth 5
} catch {
Write-Host "Error occurred:"
$_.Exception.Response.GetResponseStream() | %{ [System.IO.StreamReader]::new($_).ReadToEnd() }
}