Giter Club home page Giter Club logo

Comments (6)

adamcrown avatar adamcrown commented on September 17, 2024

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.

alainmeier avatar alainmeier commented on September 17, 2024
[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.

adamcrown avatar adamcrown commented on September 17, 2024

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.

alainmeier avatar alainmeier commented on September 17, 2024
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.

adamcrown avatar adamcrown commented on September 17, 2024

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.

alainmeier avatar alainmeier commented on September 17, 2024

Oh boy, good catch, I didn't even notice those. Silly me - thanks!

from turnout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.