MarkMekhaiel
I’m trying to serve a file from my phoenix API, and believe Plug.Static is the way to do it, but am struggling to get it to work.
The file is an apple certificate, and I’m placing it in priv/certificates/apple
I’ve setup the following code in my endpoint.ex file:
plug Plug.Static,
at: "/.well-known/apple",
from: :my_app,
gzip: false,
only: ~w(certificates apple)
But when I visit the URL I get no route found for GET /.well-known/apple.
Do I need to add this to my routes file? And if so, does it hit a controller? What would that controller action look like?
Thanks in advance
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m aware of 2 such projects, are there others?
git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
Hi everyone.
My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley:
Mutonex gamedesign was finish...
New
Hello
I’ve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But ...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #hex










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
silverdr
How about simply putting it in
priv/static/...?stefanchrobot
The default path for reading static files is
priv/static, so you need to tweak it:But I’d suggest following @silverdr advice and put the files in the usual location. Assuming the actual file is called
apple, try this:/priv/static/.well-known/appleStaticplug config:MarkMekhaiel
I must have misread - I thought files had to go into
/privand not/priv/static- many thanks both and for the specific code examplekigila
Anyone struggling with this ?
dimitarvp
What’s the problem? Doesn’t the accepted solution work for you?
kigila
I have a problem with the MIME type the server is sending to the browser. On image files the user uploads. I am saving the images locally in fly.io volumes (I am hosting my projects in fly.IO) and putting the address in a column in the users table(postgres). 60% of the time the browser receives it with content type in the HTTP response header as “text/html” and the other 40% of the time it is sent correctly as “image/jpeg”. For me, this is an advanced problem I am not ready to tackle yet. I will continue to learn Phoenix and LV in the future I will come back to this issue. Maybe I will just skip this approach and use AWS S3 like solution instead of serving the images from my local folder.
dimitarvp
You could post your relevant router config and maybe somebody else can chime in?