Skip to content

Commit

Permalink
feat: add rack-proxy for proxy requests
Browse files Browse the repository at this point in the history
  • Loading branch information
KonnorRogers committed Jul 23, 2020
1 parent d89a95c commit 8635324
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions examples/railsapp/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PATH
remote: ../..
specs:
snowpacker (0.0.2)
rack-proxy (~> 0.6.4)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -112,6 +113,8 @@ GEM
rack (2.2.3)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.3.2)
Expand Down
4 changes: 2 additions & 2 deletions examples/railsapp/app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

<%# <%= javascript_include_tag '/snowpacks/packs/application', type: "module" %1> %>
<script type="module" src="http://localhost:3000/public/snowpacks/packs/application.js"></script>
<%= javascript_include_tag '/snowpacks/packs/application', type: "module" %>
<%= javascript_include_tag 'http://localhost:3000/snowpacks/packs/application', type: "module" %>
<script>window.HMR_WEBSOCKET_URL = "ws://localhost:4035"</script>
</head>

Expand Down
1 change: 0 additions & 1 deletion examples/railsapp/config/initializers/snowpacker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@
snowpacker.stylesheets = File.join(snowpacker.out, 'stylesheets')
snowpacker.assets = File.join(snowpacker.out, 'assets')
end

7 changes: 7 additions & 0 deletions lib/snowpacker/runner_proxy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'rack/proxy'

module Snowpacker
class SnowpackerProxy < Rack::Proxy

end
end

0 comments on commit 8635324

Please sign in to comment.