Combo.URLBuilder (combo v0.10.0)
View SourceBuilds url or path.
Summary
Functions
Builds a path with relevant script name.
Builds the integrity hash to a static asset given its file path.
Builds the path to a static asset given its file path.
Builds the url to a static asset given its file path.
Builds an url.
Functions
Builds a path with relevant script name.
Examples
iex> path(conn, MyApp.Web.Router, "/posts")
"/posts"
iex> path(conn, MyApp.Web.Router, "/posts", page: 1)
"/posts?page=1"
Builds the integrity hash to a static asset given its file path.
See Combo.Endpoint.static_integrity/1 for more information.
Examples
iex> static_integrity(conn, "/assets/js/app.js")
"813dfe33b5c7f8388bccaaa38eec8382"
iex> static_integrity(socket, "/assets/js/app.js")
"813dfe33b5c7f8388bccaaa38eec8382"
iex> static_integrity(MyApp.Web.Endpoint, "/assets/js/app.js")
"813dfe33b5c7f8388bccaaa38eec8382"
Builds the path to a static asset given its file path.
See Combo.Endpoint.static_path/1 for more information.
Examples
iex> static_path(conn, "/assets/js/app.js")
"/assets/js/app-813dfe33b5c7f8388bccaaa38eec8382.js"
iex> static_path(socket, "assets/js/app.js")
"/assets/js/app-813dfe33b5c7f8388bccaaa38eec8382.js"
iex> static_path(MyApp.Web.Endpoint, "assets/js/app.js")
"/assets/js/app-813dfe33b5c7f8388bccaaa38eec8382.js"
Builds the url to a static asset given its file path.
See Combo.Endpoint.static_url/0 and Combo.Endpoint.static_path/1 for
more information.
Examples
iex> static_url(conn, "/assets/js/app.js")
"https://example.com/assets/js/app-813dfe33b5c7f8388bccaaa38eec8382.js"
iex> static_url(socket, "/assets/js/app.js")
"https://example.com/assets/js/app-813dfe33b5c7f8388bccaaa38eec8382.js"
iex> static_url(MyApp.Web.Endpoint, "/assets/js/app.js")
"https://example.com/assets/js/app-813dfe33b5c7f8388bccaaa38eec8382.js"
Builds an url.
Examples
iex> url(conn, "/posts")
"https://example.com/posts"
iex> url(conn, "/posts", page: 1)
"https://example.com/posts?page=1"