❔ Output HTML from minimal API?
I'm trying to make an HTML file with code, which will be sent through. However, simply returning the HTML makes it look like text, instead of actually parsing it.
6 Replies
probably the wrong Content-Type?
check the network tab in browser dev tools, specifically the headers on the response
content type is
text/plain
how can I change thatwell first off
why aren't you using asp.net mvc? it's kinda made for this
otherwise, I'd say look into "asp.net minimal api response content type" or similar
(my dinner's just about ready, so I need to drop)
99% of the project is handling video files
the html's a one off thing
If it's just a plain static
.html
file, you can use the file serving middleware
app.UseFileServer();
will serve all files from /wwwroot
Place your index.html
there and doneWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.