Add api package serving our api routes using gorilla/mux

This commit is contained in:
Felix Auringer
2021-04-26 12:29:31 +02:00
parent 08eb05e00f
commit 38ecc02a79
5 changed files with 32 additions and 18 deletions

16
main.go
View File

@@ -1,12 +1,14 @@
package main
import "fmt"
// HelloCodeMoon returns 'Hello, CodeMoon!'
func HelloCodeMoon() string {
return "Hello, CodeMoon!"
}
import (
"gitlab.hpi.de/codeocean/codemoon/coolcodeoceannomadmiddleware/api"
"log"
"net/http"
)
func main() {
fmt.Println(HelloCodeMoon())
err := http.ListenAndServe("0.0.0.0:4000", api.NewRouter())
if err != nil {
log.Fatal("Error during listening and serving: ", err)
}
}