Serving Video in Folder Within priv/static

Hey Folks,

I’m creating a phoenix web app that has dozens of static videos. Currently they’re making a mess in the root of my priv/static folder. I tried to move them to their own folder videos and of course I get a route error no route found for GET /videos/static_background.mp4. I feel like I just need to add a plug Plug.Static to endpoint.ex but can’t seem to nail the syntax.

Thanks,
Scott

Hello and welcome…

This is a sample config in the endpoint.ex file.

  plug Plug.Static,
    at: "/",
    from: :koko,
    gzip: true,
    only: ~w(css fonts images images/background js videos favicon.ico robots.txt)

Updating the :only parameters should do the trick :slight_smile:

5 Likes

That did the trick, knew it was something super obvious. Thanks kokolegorille!

1 Like