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/pandago
cd $GOPATH/src/github.com/scripted/pandago
You can run the server directly.
go run main.go
Compile and Run a la Heroku
go install -v ./...
heroku local
Instead of running pandago, you can also run the app directly using pandago
.
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":"OK 🐼, Go!"}
PandaGo uses govendor
to manage its dependencies.
go get -u github.com/kardianos/govendor
You can install all dependencies described in vendor/vendor.json
into the
vendor/
directory by running the following.
govendor sync
To update dependencies as described in the app, run the following.
govendor add +external
govendor remove +unused
For more info, checkout out Heroku's page on govendor.
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 -i https://<YOUR_APP_NAME>.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":"OK 🐼, Go!"}