From e40bbaf3fbbb57dc798269d77f1769edea4a9253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Pailharey?= <rpailharey@grandlyon.com> Date: Fri, 9 Jul 2021 10:52:17 +0200 Subject: [PATCH] Initial commit Main structure for golang backend --- go.mod | 3 +++ internal/rootmux/rootmux.go | 11 +++++++++++ main.go | 16 ++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 go.mod create mode 100644 internal/rootmux/rootmux.go create mode 100644 main.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..2370243 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module forge.grandlyon.com/web-et-numerique/llle_project/backoffice-server + +go 1.15 diff --git a/internal/rootmux/rootmux.go b/internal/rootmux/rootmux.go new file mode 100644 index 0000000..0691a57 --- /dev/null +++ b/internal/rootmux/rootmux.go @@ -0,0 +1,11 @@ +package rootmux + +import ( + "net/http" +) + +func CreateRootMux(staticDir string) http.Handler { + mainMux := http.NewServeMux() + + return mainMux +} diff --git a/main.go b/main.go new file mode 100644 index 0000000..75917cc --- /dev/null +++ b/main.go @@ -0,0 +1,16 @@ +package main + +import ( + "log" + "net/http" + + "forge.grandlyon.com/web-et-numerique/llle_project/backoffice-server/internal/rootmux" +) + +func main() { + log.Println("--- Server is starting ---") + + // Create main server + mainMux := rootmux.CreateRootMux("web") + http.ListenAndServe(":8080", mainMux) +} -- GitLab