diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-04-26 21:47:21 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-05-01 23:15:10 +0300 |
commit | 996e5d79dfefac5dd5cacbfdd08c443f007f4492 (patch) | |
tree | 98da12a35c4c4a21c7c578696a608d962cf69730 /lib/gitlab/middleware | |
parent | f65a1da09353b605acbf349a2d3d024b4abef38c (diff) |
move dev server middleware to new namespace
Diffstat (limited to 'lib/gitlab/middleware')
-rw-r--r-- | lib/gitlab/middleware/webpack_proxy.rb | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/gitlab/middleware/webpack_proxy.rb b/lib/gitlab/middleware/webpack_proxy.rb deleted file mode 100644 index 6aecf63231f..00000000000 --- a/lib/gitlab/middleware/webpack_proxy.rb +++ /dev/null @@ -1,26 +0,0 @@ -# This Rack middleware is intended to proxy the webpack assets directory to the -# webpack-dev-server. It is only intended for use in development. - -# :nocov: -module Gitlab - module Middleware - class WebpackProxy < Rack::Proxy - def initialize(app = nil, opts = {}) - @proxy_host = opts.fetch(:proxy_host, 'localhost') - @proxy_port = opts.fetch(:proxy_port, 3808) - @proxy_path = opts[:proxy_path] if opts[:proxy_path] - - super(app, backend: "http://#{@proxy_host}:#{@proxy_port}", **opts) - end - - def perform_request(env) - if @proxy_path && env['PATH_INFO'].start_with?("/#{@proxy_path}") - super(env) - else - @app.call(env) - end - end - end - end -end -# :nocov: |