Pandoc, wrapped in Go
It's better to use go get
instead of git clone
so that your repo ends up
somewhere in the $GOPATH
(which is relied on by govendor
).
go get github.com/scripted/go-panda
You can run the server directly.
go run main.go
Compile and Run a la Heroku
go install -v ./...
heroku local
Instead of running go-panda, you can also run the app directly using go-panda
.
curl -i localhost:8080
#
# HTTP/1.1 200 OK
# Content-Type: application/json; charset=utf-8
# Date: Tue, 11 Oct 2016 21:53:14 GMT
# Content-Length: 19
#
# {"message":"pong"}
Create the Heroku app as usual:
heroku create
Add the official heroku/go
buildpack as well as the a buildpack for installing
custom binaries so we can install Pandoc via .custom_binaries
:
heroku buildpacks:add heroku/go
heroku buildpacks:add https://github.com/tonyta/heroku-buildpack-custom-binaries#v1.0.0
That's it. Then just push it to Heroku like normal.
git push heroku master
curl https://go-panda.herokuapp.com
#
# HTTP/1.1 200 OK
# Server: Cowboy
# Connection: keep-alive
# Content-Type: application/json; charset=utf-8
# Date: Tue, 11 Oct 2016 21:51:06 GMT
# Content-Length: 19
# Via: 1.1 vegur
#
# {"message":"pong"}