HTTP::StaticFileHandler

class HTTP::StaticFileHandler

Overview

A simple handler that lists directories and serves files under a given public directory.

Included Modules

Defined in:

http/server/handlers/static_file_handler.cr

Class Method Summary

Instance Method Summary

Class Method Detail

def self.new(public_dir : String, fallthrough = true)Source

Creates a handler that will serve files in the given public_dir, after expanding it (using File#expand_path).

If fallthrough is false, this handler does not call next handler when request method is neither GET or HEAD, then serves 405 Method Not Allowed. Otherwise, it calls next handler.

Instance Method Detail

def call(context)Source

© 2012–2017 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.22.0/HTTP/StaticFileHandler.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部