24 lines
372 B
Go
24 lines
372 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
"net/http/cgi"
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
func main() {
|
|
port := os.Getenv("PORT")
|
|
if port == ""{port = "8080"}
|
|
wap, err := exec.LookPath("wapptclsh")
|
|
if err != nil {log.Fatal(err)}
|
|
|
|
log.Printf("Listening on port %s", port)
|
|
http.ListenAndServe(":" + port, &cgi.Handler{
|
|
Path: wap,
|
|
Dir: ".",
|
|
Args: []string{"site.tcl"},
|
|
})
|
|
}
|