mirror of
https://codeberg.org/gothub/RandomInstance
synced 2024-12-06 19:16:49 +01:00
@@ -10,5 +10,7 @@ COPY . /usr/src/app/
|
||||
# expose the port
|
||||
EXPOSE 8080
|
||||
|
||||
ENV DOCKER=true
|
||||
|
||||
# run the server
|
||||
CMD [ "pwsh", "-c", "cd /usr/src/app; ./server.ps1" ]
|
||||
+8
-1
@@ -1,5 +1,12 @@
|
||||
Start-PodeServer {
|
||||
Add-PodeEndpoint -Address localhost -Port 8080 -Protocol Http
|
||||
# get docker environment variable
|
||||
$docker = $env:DOCKER
|
||||
|
||||
if ($docker) {
|
||||
Add-PodeEndpoint -Address * -Port 8080 -Protocol Http
|
||||
} else {
|
||||
Add-PodeEndpoint -Address localhost -Port 8080 -Protocol Http
|
||||
}
|
||||
|
||||
Add-PodeRoute -Method Get -Path '/' -ScriptBlock {
|
||||
Write-PodeJsonResponse -Value @{ Response = 'Hello World' }
|
||||
|
||||
Reference in New Issue
Block a user