This commit is contained in:
2023-12-18 16:51:47 +01:00
commit 88741b2303
36 changed files with 1490 additions and 0 deletions

23
cmd/web/web.go Normal file
View File

@@ -0,0 +1,23 @@
package main
import (
"gitlab.com/kbr4/svevijesti/internal/server"
"log"
"net/http"
"time"
)
func main() {
r := server.CreateRoutes()
http.Handle("/", r)
srv := &http.Server{
Handler: r,
Addr: "127.0.0.1:8080",
// Good practice: enforce timeouts for servers you create!
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}
log.Fatal(srv.ListenAndServe())
}