Compare commits
2 Commits
ddf967468f
...
1132f77249
| Author | SHA1 | Date | |
|---|---|---|---|
| 1132f77249 | |||
| 76e39783d0 |
27
server.go
27
server.go
@ -1 +1,26 @@
|
|||||||
package httpi
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Server struct {
|
||||||
|
httpServer *http.Server
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewServer() *Server {
|
||||||
|
return &Server{
|
||||||
|
httpServer: &http.Server{
|
||||||
|
Addr: ":8080",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Server) Start() error {
|
||||||
|
return s.httpServer.ListenAndServe()
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
server := NewServer()
|
||||||
|
server.Start()
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user