Commit fa21183e authored by Damien Mathieu's avatar Damien Mathieu

json_file is undefined. Use USER_CONFIG

parent 6004416e
...@@ -4,7 +4,7 @@ eval(File.read('/app/bin/config/lib/nginx_config_util.rb')) ...@@ -4,7 +4,7 @@ eval(File.read('/app/bin/config/lib/nginx_config_util.rb'))
USER_CONFIG = "/app/static.json" USER_CONFIG = "/app/static.json"
config = {} config = {}
config = JSON.parse(File.read(USER_CONFIG)) if File.exist?(json_file) config = JSON.parse(File.read(USER_CONFIG)) if File.exist?(USER_CONFIG)
req = Nginx::Request.new req = Nginx::Request.new
uri = req.var.uri uri = req.var.uri
......
...@@ -24,6 +24,16 @@ RSpec.describe "Simple" do ...@@ -24,6 +24,16 @@ RSpec.describe "Simple" do
expect(response.body.chomp).to eq("Hello World") expect(response.body.chomp).to eq("Hello World")
end end
describe "no config" do
let(:name) { "no_config" }
it "should serve out of public_html by default" do
response = app.get("/")
expect(response.code).to eq("200")
expect(response.body.chomp).to eq("Hello World")
end
end
describe "root" do describe "root" do
let(:name) { "different_root" } let(:name) { "different_root" }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment