You can create an app in Heroku with Crystal's buildpack by running the following command:
$ heroku create myapp --buildpack https://github.com/bitstopco/heroku-buildpack-crystal.git
The default behaviour is to use the latest crystal release.
If you need to use a specific version create a
.crystal-version file in your
application root directory with the version that should be used (e.g.
In order for the buildpack to work properly you need to have a
targets: defined, as it is how it will detect that your app is a Crystal app
and which binaries to build.
Procfile must also be present in order to execute the binaries.
Your application has to listen on a port defined by Heroku. It is given to you
through the command line option
--port and the environment variable
ENV["PORT"] in Crystal). However, most web frameworks
should handle this for you.
To test a change to this buildpack, write a unit test in
tests/run that asserts your change and
make test to ensure the change works as intended and does not break backwards compatibility.
To learn more about how to deploy a Crystal application to Heroku, read our blog post.
If you have and older version of Crystal (
<= 0.9), that uses the old
Projectfile way of handling dependencies, please upgrade :-).
Copy the snippet above into CLI.