How to serve a next js application with gorilla mux in Golang instead of the native go http package?

159 Views Asked by At

I have a go backend and inside my controllers i have a routes.go that uses gorilla mux router. How can i serve a static next js application using gorilla mux?

1

There are 1 best solutions below

0
Manos Kalogeropoulos On

s.Router.PathPrefix("/").Handler(http.FileServer(http.Dir("nextjs/dist"))) That's how i managed to serve the static next.js