Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

coffeescript serving

  • Loading branch information...
commit bf2cebc24e15f433d9a04f8b49941361eff9590d 1 parent 8975a39
@geelen authored
View
1  Gemfile
@@ -3,3 +3,4 @@ gem 'thin'
gem 'sinatra'
gem 'sinatra-contrib'
gem 'haml'
+gem 'coffee-script'
View
8 Gemfile.lock
@@ -2,9 +2,16 @@ GEM
remote: http://rubygems.org/
specs:
backports (2.6.1)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.2.0)
daemons (1.1.8)
eventmachine (0.12.10)
+ execjs (1.3.0)
+ multi_json (~> 1.0)
haml (3.1.4)
+ multi_json (1.2.0)
rack (1.4.1)
rack-protection (1.2.0)
rack
@@ -31,6 +38,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ coffee-script
haml
sinatra
sinatra-contrib
View
6 app.rb
@@ -1,5 +1,7 @@
require 'sinatra'
require 'sinatra/reloader' if development?
+require 'coffee-script'
+require 'haml'
set :haml, format: :html5
set :views, '.'
@@ -7,3 +9,7 @@
get '/' do
haml :index
end
+
+get '/application.js' do
+ coffee :application
+end
View
0  application.coffee
No changes.
View
1  index.haml
@@ -2,5 +2,6 @@
%html
%head
%script(src='http://code.angularjs.org/angular-1.0.0rc10.min.js')
+ %script(src='/application.js')
%body(ng-app)
%h1 {{ 1 + 2 }}
Please sign in to comment.
Something went wrong with that request. Please try again.