Skip to content

Commit

Permalink
add kw :named to add_fileroute()
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Feb 19, 2024
1 parent acb5a26 commit 8eed724
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Assets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function add_fileroute(assets_config::Genie.Assets.AssetsConfig, filename::Abstr
basedir = pwd(),
type::Union{Nothing, String} = nothing,
content_type::Union{Nothing, Symbol} = nothing,
ext::Union{Nothing, String} = nothing, kwargs...)
ext::Union{Nothing, String} = nothing, named::Union{Symbol, Nothing} = nothing, kwargs...)

file, ex = splitext(filename)
ext = isnothing(ext) ? ex : ext
Expand All @@ -345,7 +345,7 @@ function add_fileroute(assets_config::Genie.Assets.AssetsConfig, filename::Abstr
Symbol("*.*")
end : content_type

Genie.Router.route(Genie.Assets.asset_path(assets_config, type; file, ext, kwargs...)) do
Genie.Router.route(Genie.Assets.asset_path(assets_config, type; file, ext, kwargs...); named) do
Genie.Renderer.WebRenderable(
Genie.Assets.embedded(Genie.Assets.asset_file(cwd=basedir; type, file)),
content_type) |> Genie.Renderer.respond
Expand Down

0 comments on commit 8eed724

Please sign in to comment.