I got a golang web application which has frontend and backend separation via apis. I was serving static files in the same port using http.FileServer(http.Dir(ServerHome+"/webapps/apieditor/"), it was with very limited features.
Now I’m trying to use Caddy to server the static content on a different port without altering the apis port. I tired to follow the documentation on embedding Caddy in golang but couldn’t find a concert example.
So I ended up using the Caddy binary externally. Does anyone have a good example of embedding Caddy server in go?.
Oh yeah – you have to import a server type, too. Otherwise Caddy doesn’t know how to serve anything. (I do need to improve the docs here… been working on a new site and updated developer wiki though!)