jodosha (owner)

Revisions

gist: 103009 Download_button fork
public
Public Clone URL: git://gist.github.com/103009.git
Embed All Files: show embed
app/metal/legacy_routes.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
 
class LegacyRoutes
  class << self
    def call(env)
      if env["PATH_INFO"] =~ /^\/pages\//
        [301, {"Location" => "/projects", "Content-Type" => "text/html"}, ["Moved Permanently"]]
      else
        [404, {"Content-Type" => "text/html"}, ["Not Found"]]
      end
    end
  end
end