Created
January 8, 2026 19:58
-
-
Save havenwood/54fd3243905d4a5f3a7349eb27ad512b to your computer and use it in GitHub Desktop.
Example showing running Falcon locally from a single file (IRC question about ditching config.ru)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env -S falcon-host | |
| # frozen_string_literal: true | |
| require "falcon/environment/rack" | |
| require "roda" | |
| class App < Roda | |
| route do |r| | |
| r.root { "wombat" } | |
| end | |
| end | |
| service "wombat-app" do | |
| include Falcon::Environment::Rack | |
| middleware do | |
| Falcon::Server.middleware(App.freeze.app, verbose:, cache:) | |
| end | |
| endpoint do | |
| Async::HTTP::Endpoint.parse("http://localhost:9292") | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment