udemy-go-web-1/cmd/web/main.go

20 lines
346 B
Go
Raw Normal View History

2024-06-26 15:30:39 +00:00
package main
import (
"fmt"
2024-06-26 20:06:32 +00:00
"go-udemy-web-1/pkg/handlers"
2024-06-26 15:30:39 +00:00
"net/http"
)
2024-06-26 15:41:50 +00:00
const portNumber = ":8080"
// main is the main application function
2024-06-26 15:30:39 +00:00
func main() {
2024-06-26 20:06:32 +00:00
http.HandleFunc("/", handlers.Home)
http.HandleFunc("/about", handlers.About)
2024-06-26 15:41:50 +00:00
fmt.Printf("Starting application on port %s\n", portNumber)
_ = http.ListenAndServe(portNumber, nil)
2024-06-26 15:30:39 +00:00
}