mirror of
https://github.com/lloeki/minimal-rack/
synced 2025-12-06 13:14:39 +01:00
Make apps uniform
This commit is contained in:
parent
de989153e4
commit
cfba5211d0
6 changed files with 127 additions and 13 deletions
23
rails.rb
Normal file → Executable file
23
rails.rb
Normal file → Executable file
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
begin
|
||||
require "bundler/inline"
|
||||
rescue LoadError => e
|
||||
|
|
@ -21,16 +23,17 @@ end.tap do |m|
|
|||
end.first
|
||||
server = ARGV[1] || 'thin'
|
||||
|
||||
gems = match.fetch('gem', {})
|
||||
gemfile(true) do
|
||||
source "https://rubygems.org"
|
||||
|
||||
ruby match['ruby']
|
||||
|
||||
gem 'rails', "~> #{version}.0"
|
||||
gem server
|
||||
gem 'ddtrace', path: '../../Datadog/dd-trace-rb', require: 'ddtrace/auto_instrument'
|
||||
gem server unless gems.key?(server)
|
||||
gem 'ddtrace'
|
||||
|
||||
match.fetch('gem', []).each do |name, requirement|
|
||||
gems.each do |name, requirement|
|
||||
gem name, requirement
|
||||
end
|
||||
end
|
||||
|
|
@ -163,6 +166,7 @@ class App < Rails::Application
|
|||
get "/hello/world" => "hello#world"
|
||||
get "/hello/:id" => "hello#world"
|
||||
|
||||
#mount SimpleEngine::Engine => "/"
|
||||
mount SimpleEngine::Engine => "/engine/simple"
|
||||
mount EndpointEngine::Engine => "/engine/endpoint"
|
||||
mount RackApp => "/rack"
|
||||
|
|
@ -193,13 +197,24 @@ class HelloController < action_controller_api_class
|
|||
end
|
||||
end
|
||||
|
||||
require 'ddtrace'
|
||||
|
||||
Datadog.configure do |c|
|
||||
c.diagnostics.debug = ['true', '1'].include?(ENV['DD_DIAGNOSTICS'])
|
||||
c.diagnostics.debug = true
|
||||
|
||||
c.telemetry.enabled = true
|
||||
|
||||
c.remote.enabled = true
|
||||
|
||||
c.tracing.enabled = true
|
||||
c.tracing.instrument :rack
|
||||
c.tracing.instrument :rails
|
||||
c.tracing.instrument :sinatra
|
||||
c.tracing.instrument :grape
|
||||
|
||||
c.appsec.enabled = true
|
||||
c.appsec.instrument :rack
|
||||
c.appsec.instrument :rails
|
||||
end
|
||||
|
||||
SimpleApp::App.initialize!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue