27 lines
317 B
Go
27 lines
317 B
Go
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()
|
|
}
|