Skip to content

Latest commit

 

History

History
156 lines (102 loc) · 2.91 KB

kemal.md

File metadata and controls

156 lines (102 loc) · 2.91 KB

Kemal

{id: kemal}

About Kemal

{id: kemal-about}

  • Kemal
  • Created by Serdar Dogruyol

Kemal Install

{id: kemal-install}

Create a directory and create the following file in it:

Run the following command in the directory

shards install

If it fails with Failed to resolve dependencies, try updating incompatible shards or use --ignore-crystal-version as a workaround if no update is available.

then try this:

shards install --ignore-crystal-version

Hello World

{id: kemal-hello-world}

crystal src/hello_world.cr
http://localhost:3000/

Testing Hello World

{id: kemal-testing-hello-world}

crystal spec/hello_world_spec.cr

Kemal Autorestart (autoreload)

{id: kemal-autorestart}

crystal build --release lib/sentry/src/sentry_cli.cr -o ./bin/sentry
./bin/sentry -b "crystal build src/webapp.cr -o bin/webapp" -r bin/webapp

Kemal GET parameters

{id: kemal-get-parameters} {i: GET}

crystal spec/get_params_spec.cr

Kemal POST parameters

{id: kemal-post-parameters} {i: POST}

crystal spec/post_params_spec.cr

Kemal Route parameters

{id: kemal-route-parameters}

crystal spec/post_params_spec.cr

Kemal ECR Templates

{id: kemal-ecr-templates}

Kemal with Jinja templates

{id: kemal-jinja-templates}

Kemal Elapsed time

{id: kemal-elapsed-time}

Accept GET, POST, and route parameter in the same POST route

{id: kemal-get-post-route}

Kemal indicate 404

{id: kemal-indicate-404}

Kemal Styling 404 pages

{id: kemal-styling-404-pages}

Kemal set headers (change content-type)

{id: kemal-set-header}

Kemal redirect

{id: kemal-redirect}

Kemal in Docker

{id: kemal-in-docker}