github facebook twitter

Getting Started

1. Install Crystal


brew update
brew install crystal-lang

Debian / Ubuntu

curl | sudo bash
sudo apt-get install crystal

For other OSes and distros check the official documentation.

2. Install Kemal

You should create your application first:

crystal init app your_app
cd your_app

Then add kemal to the shard.yml file as a dependency.

    github: kemalcr/kemal
    branch: master

You should run shards to get dependencies:

shards install

It will output something like that:

$ shards install
Installing kemal (master)

3. Add Kemal

Open your_app/src/ and require kemal to use Kemal.

require "kemal"

4. Hack!

Do some awesome stuff with awesome Kemal.

get "/" do
  "Hello World!"

All the code should look like this:

require "kemal"

get "/" do
  "Hello World!"

5. Run!

crystal build --release src/

You should see some logs like these:

[development] Kemal is ready to lead at
2015-12-01 13:47:48 +0200 | 200 | GET / - (666µs)
2015-12-05 13:47:48 +0200 | 404 | GET /favicon.ico - (14µs)

Now you can be happy with your new, very fast, readable web project.