This commit is contained in:
Sotig
2026-05-29 21:16:10 +03:00
parent 778380dc35
commit 0c40983293
35 changed files with 4905 additions and 1 deletions

31
api/cmd/main.go Normal file
View File

@@ -0,0 +1,31 @@
package main
import (
"fmt"
"net/http"
"os"
"runtime/debug"
"golang.org/x/net/http2"
)
func main() {
var memLimitMb int64 = 512
debug.SetMemoryLimit(memLimitMb * 1024 * 1024)
// Your code here
mux := http.NewServeMux()
svr := &http.Server{
Addr: fmt.Sprintf("%s:%s", os.Getenv("HOST"), os.Getenv("PORT")),
Handler: mux,
}
http2.ConfigureServer(svr, nil)
actions(mux) // Register actions with the multiplexer
fmt.Printf("Starting server on %s:%s\n", os.Getenv("HOST"), os.Getenv("PORT"))
err := svr.ListenAndServe()
if err != nil {
panic(err)
}
}