I'm trying to serve an Angular application (Angular 8.2.14) from a server written in Go.
Searching around I found the following snippet that supposedly makes the trick.
func main() {
http.ListenAndServe(":4000", http.FileServer(http.Dir(folderDist)))
}
Where folderDist is the directory where I made ng build of my application.
When I navigate to localhost:4000 in my examples, I receive on the browser the following errors:
runtime-es2015.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
styles-es2015.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
main-es2015.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
polyfills-es2015.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
vendor-es2015.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
What am I missing?
I've tried the solution suggested here, but the errors are still the same.