-
-
Save cj/8e363e15ab9b3db0c775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opal = Opal::Server.new do |s| | |
# Append the gems path | |
s.debug = true | |
s.source_map = true | |
s.append_path Gem::Specification.find_by_name("roda-component").gem_dir + '/lib' | |
# Append the path to the components folder | |
s.append_path scope.component_opts[:path] | |
s.main = 'roda/component' | |
end | |
on self.class.component_assets_route_regex do |component, action| | |
path = scope.request.env['REQUEST_PATH'] | |
if path[/\.js\Z/] | |
run opal.sprockets | |
else | |
run Opal::SourceMapServer.new(opal.sprockets, path) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment