Skip to content
Snippets Groups Projects
Commit 28e6c057 authored by Benjamin skinstad's avatar Benjamin skinstad
Browse files

trying to deploy herouku

parent e44188c1
No related branches found
No related tags found
No related merge requests found
web: main
File added
......@@ -7,6 +7,7 @@ import (
"io/ioutil"
"log"
"math"
"os"
"runtime"
"strconv"
"strings"
......@@ -105,7 +106,14 @@ func main() {
http.HandleFunc(diagFilter, diag)
http.ListenAndServe(":8080", nil)
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
println(port)
log.Fatal(http.ListenAndServe(":"+port, nil))
}
......@@ -209,15 +217,26 @@ func country(w http.ResponseWriter, r *http.Request){
var countryJsonArray []speciesJSON2
var yearJsonArray []specisYearJson
var duplicateCheck = ""
for i:=0; i<tempLimit ;i++ {
keyTest := fmt.Sprintf("%f", spectest.ArryJson[i].Key)
println(keyTest)
if strings.Contains(duplicateCheck, keyTest) {
continue
}
duplicateCheck += keyTest
for i:=0; i<tempLimit ;i++ {
key := spectest.ArryJson[i].Key
kingdom := spectest.ArryJson[i].Kingdom
phylum := spectest.ArryJson[i].Phylum
order := spectest.ArryJson[i].Order
family := spectest.ArryJson[i].Family
family := spectest.ArryJson[i].Family
genus := spectest.ArryJson[i].Genus
scientificName := spectest.ArryJson[i].ScientificName
canonicalName := spectest.ArryJson[i].CanonicalName
......@@ -446,4 +465,5 @@ func diag(w http.ResponseWriter, r *http.Request){
io.WriteString(w,string(e))
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment