skeleton for testing purposes
This commit is contained in:
1 parent
8076b30e3f
commit
71e4f1294e
11 files changed
+273
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package http_internal
|
||||
|
||||
import "net/http"
|
||||
|
||||
type AppServer struct {
|
||||
srv *http.Server
|
||||
mux *http.ServeMux
|
||||
}
|
||||
|
||||
func NewAppServer() *AppServer {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
fs := http.FileServer(http.Dir("web/"))
|
||||
|
||||
mux.Handle("/", fs)
|
||||
|
||||
srv := &http.Server{
|
||||
Addr: "localhost:1234",
|
||||
Handler: mux,
|
||||
}
|
||||
|
||||
return &AppServer{
|
||||
srv: srv,
|
||||
mux: mux,
|
||||
}
|
||||
}
|
||||
|
||||
func (srv *AppServer) Start() {
|
||||
srv.srv.ListenAndServe()
|
||||
}
|
||||
Reference in new issue
Block a user