Monitorex.Assets (monitorex v0.3.0)

Copy Markdown

Plug for serving Monitorex dashboard static assets (CSS and JS).

Reads the asset files at compile time and serves them with far-future cache headers.

Usage

In your router:

get "/dashboard-assets/*path", Monitorex.Assets, :call

Or in a plug pipeline:

plug Monitorex.Assets, at: "/dashboard-assets"

Summary

Functions

Plug call callback. Serves the requested asset file or returns 404.

Returns the MD5 hex digest of the CSS file contents.

Plug init callback. Accepts options including :at for the mount path.

Returns the MD5 hex digest of the JS file contents.

Functions

call(conn, opts)

Plug call callback. Serves the requested asset file or returns 404.

css_hash()

Returns the MD5 hex digest of the CSS file contents.

init(opts)

Plug init callback. Accepts options including :at for the mount path.

Options

  • :at — the path prefix where assets are mounted (default: "/dashboard-assets")

js_hash()

Returns the MD5 hex digest of the JS file contents.