diff --git a/src/kemal/dsl.cr b/src/kemal/dsl.cr index de16a86..987be1c 100644 --- a/src/kemal/dsl.cr +++ b/src/kemal/dsl.cr @@ -1,3 +1,6 @@ +# Kemal DSL is defined here and it's baked into global scope. +# The DSL currently consists of HTTP verbs(get post put patch delete options), +# WebSocket(ws) and custom error handler(error). HTTP_METHODS = %w(get post put patch delete options) {% for method in HTTP_METHODS %} diff --git a/src/kemal/static_file_handler.cr b/src/kemal/static_file_handler.cr index c31d367..f7fd79d 100644 --- a/src/kemal/static_file_handler.cr +++ b/src/kemal/static_file_handler.cr @@ -1,3 +1,8 @@ +# Kemal::StaticFileHandler is used to serve static files(.js/.css/.png e.g). +# This handler is on by default and you can disable it like. +# +# serve_static false +# class Kemal::StaticFileHandler < HTTP::StaticFileHandler def call(context) return call_next(context) if context.request.path.not_nil! == "/" diff --git a/src/kemal/view.cr b/src/kemal/view.cr index 4062abd..95b60d4 100644 --- a/src/kemal/view.cr +++ b/src/kemal/view.cr @@ -1,3 +1,6 @@ +# This file contains the built-in view templates that Kemal uses. +# Currently it contains templates for 404 and 500 error codes. + # Template for 404 Not Found def render_404 template = <<-HTML