File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- config.json
1+ config.json
2+ build
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ package_name=" nova-proxy"
3+
4+
5+ platforms=(" windows/amd64" " windows/386" " darwin/amd64" )
6+
7+ for platform in " ${platforms[@]} "
8+ do
9+ platform_split=(${platform// \/ / } )
10+ GOOS=${platform_split[0]}
11+ GOARCH=${platform_split[1]}
12+ output_name=$package_name ' -' $GOOS ' -' $GOARCH
13+ if [ $GOOS = " windows" ]; then
14+ output_name+=' .exe'
15+ fi
16+
17+ env GOOS=$GOOS GOARCH=$GOARCH go build -o build/$output_name
18+ if [ $? -ne 0 ]; then
19+ echo ' An error has occurred! Aborting the script execution...'
20+ exit 1
21+ fi
22+ done
Original file line number Diff line number Diff line change @@ -3,8 +3,10 @@ package main
33import (
44 "log"
55 "net/http"
6+ "os"
67
78 "github.com/ara-framework/nova-proxy/config"
9+ "github.com/gookit/color"
810)
911
1012func init () {
@@ -14,5 +16,13 @@ func init() {
1416
1517func main () {
1618 config .SetUpLocations ()
17- log .Fatal (http .ListenAndServe (":8080" , nil ))
19+
20+ port := os .Getenv ("PORT" )
21+
22+ if len (port ) == 0 {
23+ port = "8080"
24+ }
25+
26+ color .Info .Printf ("Nova proxy running on http://0.0.0.0:%s\n " , port )
27+ log .Fatal (http .ListenAndServe (":" + port , nil ))
1828}
You can’t perform that action at this time.
0 commit comments