miguelgrinberg / microblog-api

A modern (as of 2024) Flask API back end.
MIT License
367 stars 99 forks source link

how would i add serving static files with return file(filename) in the posts endpoint to return images for the posts #14

Closed anonhacker47 closed 4 months ago

miguelgrinberg commented 2 years ago

Returning a file is not a great idea. The post should return image URLs, which I guess you can generate with url_for(). Then for development Flask serves these images, but in production you have a file server that gets these before they get to Flask. For example nginx.