Hello everyone, I am a newcomer to this forum and have limited experience with Angular2
and Golang
.
I am currently facing an issue as I want to experiment with a template on a Go
server.
To tackle this, I created a main.go
file that includes the following main()
function:
func main() {
r := mux.NewRouter()
p := http.StripPrefix("/", http.FileServer(http.Dir("./src/")))
n := http.StripPrefix("/config", http.FileServer(http.Dir("./config/")))
r.PathPrefix("/config/").Handler(n)
r.PathPrefix("/").Handler(p)
fmt.Printf("Starting server on :33166 \n")
http.ListenAndServe(":33166", r)
}
After running go run main.go
in the project directory, I encountered a failure with this request:
GET http://127.0.0.1:33166/webpack-dev-server.js
Although the solution may be straightforward, I seem unable to resolve it on my own. Any suggestions on how to successfully run the project on the server would be greatly appreciated. Thank you.