Skip to content
Snippets Groups Projects
Commit a8ced2c2 authored by slappfisk's avatar slappfisk
Browse files

Fixed PORT path

parent d7acc7f8
Branches master
No related tags found
No related merge requests found
......@@ -2,8 +2,6 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="186468f7-d825-45e2-b16f-6edf3b29029d" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Main.go" beforeDir="false" afterPath="$PROJECT_DIR$/Main.go" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
......
......@@ -2,7 +2,9 @@ package main
import (
"CloudTechAssignment1/internal"
"log"
"net/http"
"os"
"time"
)
......@@ -10,9 +12,17 @@ import (
var StartTime = time.Now()
func main() {
internal.StartTime = StartTime
port := os.Getenv("PORT")
if port == "" {
log.Fatal("$PORT must be set")
}
http.HandleFunc("/conservation/v1/diag/", internal.DiagnosticHandler)
http.HandleFunc("/conservation/v1/species/", internal.SpeciesHandler)
http.HandleFunc("/conservation/v1/country/", internal.CountryHandler)
http.ListenAndServe(":PORT", nil)
log.Fatal(http.ListenAndServe(":"+port, nil))
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment