FormMaker/demo/main.go

24 lines
464 B
Go
Raw Normal View History

2024-09-06 02:40:50 -06:00
package main
import (
"log"
"net/http"
)
func main() {
// Serve static files from the "static" directory
fs := http.FileServer(http.Dir("./static"))
// Serve static content at the root URL ("/")
http.Handle("/", http.StripPrefix("/", fs))
// Log the server status
log.Println("Serving at http://localhost:8080")
// Start the web server on port 8080
err := http.ListenAndServe(":8080", nil)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}