You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
395 B
25 lines
395 B
package main |
|
|
|
import ( |
|
"log" |
|
"net/http" |
|
"strconv" |
|
) |
|
|
|
var appConfig *config |
|
|
|
func init() { |
|
cfg, err := parseConfig() |
|
if err != nil { |
|
log.Fatal(err) |
|
} |
|
appConfig = cfg |
|
} |
|
|
|
func main() { |
|
if !checkRequiredConfig(appConfig) { |
|
log.Fatal("Not all required configurations are set") |
|
} |
|
http.HandleFunc("/", FormHandler) |
|
log.Fatal(http.ListenAndServe(":"+strconv.Itoa(appConfig.Port), nil)) |
|
}
|
|
|