You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
515 B
30 lines
515 B
package main |
|
|
|
import ( |
|
"embed" |
|
"io/fs" |
|
"log" |
|
"net/http" |
|
|
|
"git.atik.me/basicweb/app" |
|
) |
|
|
|
//go:embed web |
|
var webFS embed.FS |
|
|
|
//go:embed labs |
|
var labsFS embed.FS |
|
|
|
func main() { |
|
webFS, _ := fs.Sub(webFS, "web") |
|
app := app.New(labsFS, webFS) |
|
|
|
http.HandleFunc("/", app.MainPageHandler) |
|
http.HandleFunc("/lab", app.LabPageHandler) |
|
|
|
http.Handle("/static/", http.FileServer(http.FS(app.WebFS))) |
|
http.Handle("/labs/", http.FileServer(http.FS(app.LabsFS))) |
|
|
|
err := http.ListenAndServe(":80", nil) |
|
log.Fatal(err) |
|
}
|
|
|