server: implement chi

This commit is contained in:
2026-05-12 02:30:13 +00:00
parent 40768f0c3a
commit 9dcbd54387
4 changed files with 31 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
package api
import (
"net/http"
"github.com/go-chi/chi/v5"
)
func Start() {
r := chi.NewRouter()
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("hello world"))
})
http.ListenAndServe(":3000", r)
}
+2
View File
@@ -1,3 +1,5 @@
module git.dubyatp.xyz/dubyatp/scannerbot/server
go 1.26.3
require github.com/go-chi/chi/v5 v5.2.5 // indirect
+2
View File
@@ -0,0 +1,2 @@
github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug=
github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=
+10 -1
View File
@@ -1,5 +1,14 @@
package main
import (
"log/slog"
"git.dubyatp.xyz/dubyatp/scannerbot/server/api"
)
func main() {
println("hello world")
//println("hello world")
slog.Info("Starting the API server...")
api.Start()
}