@@ -563,12 +563,12 @@ func (x Handle) ReadTypesFiles(pathTest string, baseFilePath string, fileTypes [
|
||||
// fmt.Printf("Requested path: %s\n", user_path)
|
||||
|
||||
found := false
|
||||
index := -1;
|
||||
index := -1
|
||||
|
||||
for i, fileType := range fileTypes {
|
||||
if strings.HasSuffix(user_path, fileType) {
|
||||
found = true
|
||||
index = i;
|
||||
index = i
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -637,5 +637,11 @@ func NewHandler(db *sql.DB) *Handle {
|
||||
|
||||
func (x Handle) Startup() {
|
||||
fmt.Printf("Starting up!\n")
|
||||
log.Fatal(http.ListenAndServe(":8000", nil))
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "8000"
|
||||
}
|
||||
|
||||
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user