Created
June 9, 2023 21:28
-
-
Save twopoint718/0093819a959fb0be1d1589fd86746299 to your computer and use it in GitHub Desktop.
Single-file Rails application
This file contains 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
# Run with: | |
# $ rackup app.ru | |
require 'bundler/inline' | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rails', '~> 7.0.5' | |
gem 'puma' | |
end | |
require 'action_controller/railtie' | |
class App < Rails::Application | |
config.root = __dir__ | |
config.consider_all_requests_local = true | |
config.secret_key_base = SecureRandom.hex | |
config.eager_load = false | |
routes.append do | |
root to: 'welcome#index' | |
end | |
end | |
class WelcomeController < ActionController::Base | |
def index | |
render inline: 'Hello' | |
end | |
end | |
App.initialize! | |
run App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment