Module: Rapid::Server::Routing::Files

Defined in:
lib/ury_rapid/server/routing/files.rb

Overview

Routes for static files

Depends on the Rapid::Server::Helpers::Files helper set.

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object

Registers the file routes


9
10
11
12
13
14
15
# File 'lib/ury_rapid/server/routing/files.rb', line 9

def self.registered(app)
  # Serve all files under the /stylesheets directory as CSS.
  app.get('/stylesheets/*') { serve_text('css', 'stylesheets') }

  # Serve all files under the /scripts directory as JS.
  app.get('/scripts/*') { serve_text('javascript', 'scripts') }
end