Comments (6)
I gave it a try in a Rails and Grape app and it seemed to be working fine. Could you post some more details about your app and how you have things set up?
Also, you could try running this and see what you get.
File.expand_path(Turnout::MaintenancePage::JSON.new.send(:custom_path))
from turnout.
[3] pry(main)> File.expand_path(Turnout::MaintenancePage::JSON.new.send(:custom_path))
=> "/Users/alainmeier/Projects/blockscore-api/[#<Pathname:/Users/alainmeier/Projects/blockscore-api>, {:default=>\"tmp/maintenance.yml\"}, Turnout::MaintenancePage::JSON, \"The API is temporarily down for maintenance. Please visit status.blockscore.com for updates.\", 503]/public/maintenance.json"
I guess this explains it...
from turnout.
Yes, that's definitely a problem. That should be "/Users/alainmeier/Projects/blockscore-api/public/maintenance.json"
. I'm guessing there's something wrong with your configuration. Could you post your config file?
from turnout.
Turnout.configure do |config|
config.app_root = '.',
config.named_maintenance_file_paths = {default: config.app_root.join('tmp', 'maintenance.yml').to_s},
config.default_maintenance_page = Turnout::MaintenancePage::JSON,
config.default_reason = "The API is temporarily down for maintenance.",
config.default_response_code = 503
end
from turnout.
Oh yes. Once again I should be more careful about my README examples. Those commas shouldn't be there. Sorry about that. I've already updated the README.
This should work for you.
Turnout.configure do |config|
config.default_maintenance_page = Turnout::MaintenancePage::JSON
config.default_reason = "The API is temporarily down for maintenance."
end
The other settings will remain set to the default value if you don't change them.
from turnout.
Oh boy, good catch, I didn't even notice those. Silly me - thanks!
from turnout.
Related Issues (20)
- Support specifying the location of maintenance.yml HOT 2
- Add an option to set the `Retry-After` directive HOT 4
- Calls to application API generate error when in maintenance HOT 1
- Rake tasks don't appear in rake -T HOT 2
- Can't use this on production with unicorn! HOT 19
- Further customization/configuration of maintenance.html HOT 3
- Add support for redis/db backed configuration HOT 2
- maintenance:end can't delete maintenance.yml HOT 4
- Doesn't work in the production server HOT 5
- Can't get turnout to work on heroku HOT 5
- Maintenance helper HOT 2
- Any way to redirect to a subdominant? HOT 1
- Support Rails 4 or 5 ? HOT 1
- Rake task is not "grepable" HOT 1
- Need to restart rails app to make it work. HOT 3
- Not loading custom maintenance.html HOT 1
- undefined method 'import' when assets:precompile in prod HOT 1
- Interface to allow alternative persistence strategy
- Turnout is using an outdated Rack version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turnout.