Sha256: 21a7560dfc6f0491316c0dd67e8b4a73c7a5d2c14f17267a76aeb84fa4d48967
Contents?: true
Size: 557 Bytes
Versions: 31
Compression:
Stored size: 557 Bytes
Contents
#!/usr/bin/env falcon --verbose serve --concurrency 1 --config class EarlyHints def initialize(app) @app = app end def call(env) path = env['PATH_INFO'] early_hints = early_hints = env['rack.early_hints'] Async.logger.debug("path: #{path} #{early_hints}") if path == "/index.html" and early_hints early_hints.push("/style.css") early_hints.push("/script.js") end @app.call(env) end end use EarlyHints use Rack::Static, :urls => [""], :root => __dir__, :index => 'index.html' run lambda{|env| [404, [], ["Not Found"]]}
Version data entries
31 entries across 31 versions & 1 rubygems