32 lines
533 B
Go
32 lines
533 B
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
"fmt"
|
|
"frontends/reactNextJS"
|
|
"net/http"
|
|
)
|
|
|
|
const PORT = 3003
|
|
|
|
//go:embed "vanillaJS"
|
|
var vanillaJS embed.FS
|
|
|
|
//go:embed "react"
|
|
var react embed.FS
|
|
|
|
//go:embed "reactNextJS/out"
|
|
var nextStatic embed.FS
|
|
|
|
func main() {
|
|
|
|
http.Handle("/vanillaJS/", http.FileServerFS(vanillaJS))
|
|
http.Handle("/react/", http.FileServerFS(react))
|
|
reactNextJS.AddNextStaticClient()
|
|
|
|
err := http.ListenAndServe(fmt.Sprintf(":%d", PORT), nil)
|
|
if err != nil {
|
|
panic(fmt.Sprintf("Error starting server: %s", err))
|
|
}
|
|
}
|