Shard Detail

grip v1.0.5

The microframework for writing powerful web applications.
grip crystal web-framework websocket phoenix routing router kemal microframework

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development

  github: grip-framework/grip


The microframework for writing powerful web applications.

Actions Status

TechEmpower Benchmark

Docs CI Status

Chat on Gitter

Grip is a microframework for building RESTful web applications. It is designed to be modular and easy to use, with the ability to scale up to the limits of the Crystal programming language. It offers extensibility and has integrated middleware called "pipes". Pipes can alter parts of the request/response context and then get passed to the actual endpoint. Grip's router is very similar to the router of the Phoenix framework. And most of all: Grip is fast.


This project exists due to the fact that Kemal lacks one crucial part of a framework, a structure. An example for the absence of a structure can be found here.


  • HTTP 1.1 support.
  • WebSocket RFC 6455 support.
  • Built-in exceptions support.
  • Parameter handling support.
  • Swagger API support.
  • JSON serialization and deserialization support (fastest framework with JSON).
  • Built-in third-party module support.
  • Request/Response context, inspired by expressjs.
  • Advanced routing support.

Code example

Add this to your application's

require "grip"

class IndexController < Grip::Controllers::Http
  def get(context : Context) : Context
      .put_status(200) # Assign the status code to 200 OK.
      .json({"id" => 1}) # Respond with JSON content.
      .halt # Close the connection.

  def index(context : Context) : Context
    id =

    # An optional secondary argument gives a custom `Content-Type` header to the response.
      .json(content: {"id" => id}, content_type: "application/json; charset=us-ascii")

class Application < Grip::Application
  def routes
    get "/", IndexController
    get "/:id", IndexController, as: :index

app =


Add this to your application's shard.yml:

    github: grip-framework/grip

And run this command in your terminal:

shards install

API Reference

Documentation can be found on the official website of the Grip framework.


See our contribution guidelines and read the code of conduct.