Skip to content

Can falcon.rb be used in a sub directory? #252

Answered by ioquatix
bkuhlmann asked this question in General
Discussion options

You must be logged in to vote

Yes absolutely. I have not tested this, but this should give you an idea of how to achieve what you want:

# frozen_string_literal: true

require "falcon/environment/rack"
require "falcon/environment/tls"
require "pathname"

hostname = Pathname("..").expand_path.basename.to_s

service hostname do
  include Falcon::Environment::Rack
  include Falcon::Environment::TLS

  rackup_path { Pathname.new(self.root).join("../config.ru").to_s }

  ssl_certificate_path do
    Pathname("~/.local/state/localhost.rb/localhost.crt").expand_path.to_s
  end

  ssl_private_key_path do
    Pathname("~/.local/state/localhost.rb/localhost.key").expand_path.to_s
  end

  cache false
  count { ENV.fetch("FALCON_C…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@bkuhlmann
Comment options

@ioquatix
Comment options

@bkuhlmann
Comment options

@ioquatix
Comment options

@bkuhlmann
Comment options

Answer selected by bkuhlmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants