You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
495 B
Go
26 lines
495 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"net/http/cgi"
|
|
"os"
|
|
|
|
"faculty_media_report/pages"
|
|
)
|
|
|
|
func handler(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
|
fmt.Fprint(w, pages.MainFormPage)
|
|
}
|
|
|
|
func main() {
|
|
if os.Getenv("GATEWAY_INTERFACE") != "" {
|
|
cgi.Serve(http.HandlerFunc(handler))
|
|
} else {
|
|
http.HandleFunc("/", handler)
|
|
fmt.Fprintln(os.Stderr, "Running in standalone mode on :8080")
|
|
http.ListenAndServe(":8080", nil)
|
|
}
|
|
}
|