require 'bundler'
Bundler.require
class Beach < Sinatra::Base
set :root, File.dirname(__FILE__)
# set :protection, true
register Sinatra::AssetPack
set :assets_precompile, %w(app.js app.css *.png *.jpg *.svg *.eot *.ttf *.woff)
assets do
serve '/js', from: 'app/js' # Default
serve '/css', from: 'app/css' # Default
serve '/images', from: 'app/images' # Default
# The second parameter defines where the compressed version will be served.
# (Note: that parameter is optional, AssetPack will figure it out.)
# The final parameter is an array of glob patterns defining the contents
# of the package (as matched on the public URIs, not the filesystem)
js :app, '/js/app.js', [
'/js/vendor/**/*.js',
'/js/lib/**/*.js'
]
css :application, '/css/application.css', [
'/css/screen.css'
]
js_compression :closure
css_compression :sass
end
get '/' do
haml :index
end
post '/email' do
content_type :json
headers 'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Methods' => ['POST']
{ :message => 'email_sent' }.to_json
end
get '/:path' do
status 404
"404"
end
run! if app_file == $0
end
I am getting this error:
These are the files of my sinatra app. I am not sure what is up because I am following the documentation in the README Gemfile:
application.rb
Rakefile