Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global serve static assets #397

Merged
merged 9 commits into from
Dec 3, 2015
Merged

Global serve static assets #397

merged 9 commits into from
Dec 3, 2015

Conversation

jodosha
Copy link
Member

@jodosha jodosha commented Nov 25, 2015

Lotus Static

Introduce Lotus::Static, it's a global middleware for static assets. It's mounted inside:

  • Lotus::Container for Container architecture
  • Internal application middleware stack for Application architecture

Since v0.6, Lotus applications will use public/assets as target destination for static assets. This middleware will serve them from that directory, or lazy precompile and serve them if they're missing.

This is mounted by default in development/test environments, but disabled in production. It's slower than Nginx and it shouldn't be used in production for high performance applications.

To let Lotus to mount it, we have a new env var: SERVE_STATIC_ASSETS in .env files.

Breaking Change

This PR removes serve_static assets from Lotus::Configuration.

@jodosha jodosha self-assigned this Nov 25, 2015
@jodosha jodosha added this to the v0.6.0 milestone Nov 25, 2015
…S="true"

This enables Lotus::Static to be mounted in Rack middleware and to serve
static assets by default in development and test environments.
This allows to suppor the following scenario:

    module Web
      class Application < Lotus::Application
        configure do
          assets do
            # general assets configuration
          end
        end

        configure :production do
          assets do
            # production specific assets configuration
          end
        end
      end
    end
jodosha added a commit that referenced this pull request Dec 3, 2015
@jodosha jodosha merged commit 7741f61 into master Dec 3, 2015
@jodosha jodosha deleted the global-serve-static-assets branch December 3, 2015 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant