Skip to content
  • Edouard Chin's avatar
    868866c1
    Allow a new `server` Railtie block: · 868866c1
    Edouard Chin authored
    - This is similar to other railties blocks (such as `console`,
      `tasks` ...). The goal of this block is to allow the application
      or a railtie to load code after the server start.
    
      The use case can be to fire the webpack or react server in
      development or start some job worker like sidekiq or resque.
    
      Right now, all these tasks needs to be done in a separate
      shell and gem maintainer needs to add documentation on
      how to run their libraries if another program needs to run
      next to the Rails server.
    
      This feature can be used like this:
    
      ```ruby
        class SuperRailtie < Rails::Railtie
          server do
            WebpackServer.run
          end
        end
      ```
    868866c1
    Allow a new `server` Railtie block:
    Edouard Chin authored
    - This is similar to other railties blocks (such as `console`,
      `tasks` ...). The goal of this block is to allow the application
      or a railtie to load code after the server start.
    
      The use case can be to fire the webpack or react server in
      development or start some job worker like sidekiq or resque.
    
      Right now, all these tasks needs to be done in a separate
      shell and gem maintainer needs to add documentation on
      how to run their libraries if another program needs to run
      next to the Rails server.
    
      This feature can be used like this:
    
      ```ruby
        class SuperRailtie < Rails::Railtie
          server do
            WebpackServer.run
          end
        end
      ```
Loading