I couldn't find any example on how Vapor handles file upload, only a NodeJs example. How can I upload files using Vapor from a native mobile app? What's the workflow and how I can implement it myself?
@leoneparise@loach - I had to figure out a way to handle native mobile app file uploads without having to go through a whole release of a new version of the apps in the iOS and Google Play store. What I did is pretty easy and simple -
Spin up a small server w/ Forge & deploy your application inside the same VPC as your app running via Vapor (it has to be on a public subnet).
Add a DNS entry pointing a subdomain (I went with mobile.api.{domain}.com since our normal app runs at api.{domain}.com
Configure API Gateway to proxy all requests for that endpoint (our endpoint was something like api/v3/calls/{id}/response) to a custom URL (mobile.api.{domain}.com) that is able to do file uploads the traditional way to AWS S3.
Boom 💥you now have mobile file uploads working with 0 changes to the code