<commit_before># This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment',  __FILE__)

use Rack::Cors do
  allow do
    origins '*'
    resource '/api/*', :headers => :any, :methods => [:get, :post]
  end
end

rails_app = Rack::Builder.new do
  if ENV['RAILS_RELATIVE_URL_ROOT']
    map ENV['RAILS_RELATIVE_URL_ROOT'] do
      run Noosfero::Application
    end
  else
    run Noosfero::Application
  end
end

run Rack::Cascade.new([
  Api::App,
  rails_app
], [])
<commit_msg>Revert "api: do not forward 404 requests to rails"<commit_after># This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment',  __FILE__)

use Rack::Cors do
  allow do
    origins '*'
    resource '/api/*', :headers => :any, :methods => [:get, :post]
  end
end

rails_app = Rack::Builder.new do
  if ENV['RAILS_RELATIVE_URL_ROOT']
    map ENV['RAILS_RELATIVE_URL_ROOT'] do
      run Noosfero::Application
    end
  else
    run Noosfero::Application
  end
end

run Rack::Cascade.new([
  Api::App,
  rails_app
])

{'fraction_non_alphanumeric': 0.12827461607949414, 'fraction_numerical': 0.0027100271002710027, 'mean_word_length': 3.7758620689655173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1288316', 'n_tokens_mistral': 412, 'n_tokens_neox': 403, 'n_words': 108}