kopia lustrzana https://github.com/reiver/greatape
added (work-in-progess) HTTP server
rodzic
a0c059fa91
commit
ebb3ce510d
|
@ -0,0 +1,3 @@
|
|||
package cfg
|
||||
|
||||
const HTTPPort = 8080
|
|
@ -2,10 +2,24 @@ package main
|
|||
|
||||
import (
|
||||
_ "github.com/reiver/greatape/greataped/arg"
|
||||
"github.com/reiver/greatape/greataped/cfg"
|
||||
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("greateape daemon 🐒")
|
||||
|
||||
{
|
||||
var addr string = fmt.Sprintf(":%d", cfg.HTTPPort)
|
||||
|
||||
err := http.ListenAndServe(addr, nil)
|
||||
if nil != err {
|
||||
fmt.Fprintf(os.Stderr, "ERROR: problem with HTTP server: %s\n", err)
|
||||
os.Exit(1)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue