Skip to content

New generated image doesn't display in browser #113

@rbontekoe

Description

@rbontekoe

At first, I thought I could use the images as static files. If I added them to the public folder I only got to see them when I restarted the Bukdu server.

Then I changed the code as you see below by uncommenting the static route and added a . before /$(params.image)'. Next, I created a new image in the root folder while the server was running. Unfortunately, that didn't work either.

Question: How can I show new images in a browser?

function myimage(c::WebController)
    params = c.conn.path_params
    render(HTML, "<img src='./$(params.image)' />")
end

routes() do
    get("/img/:image", WebController, myimage)
    #plug(Plug.Static, at="/", from=normpath(@__DIR__, "public"))
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions