init: server start
This commit is contained in:
17
main.go
17
main.go
@@ -1,7 +1,20 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"sunshine.industries/some-automoderation/routes"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("hi, please")
|
||||
var port int
|
||||
flag.IntVar(&port, "port", 8080, "Port on which the server should start")
|
||||
flag.Parse()
|
||||
|
||||
fmt.Printf("Server will start on port %d", port)
|
||||
routes.RegisterRoutes()
|
||||
|
||||
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), nil))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user