Reputation: 59
I have got rest api was built with express.js and mongodb. I would like to deploy my app on netlify. I have static assets(image and videos) as well on file system. I would like to do these things with free hosting. I can deploy my app on heroku but heroku does not provide persistent storage for my assets files. Heroku gives recommendation to keep your statics assets with aws s3 storage. AWS provides 5GB storage for your static assets free if you passed the limit you have to pay for it. It's a bit scary thing to me.
So, Is there any way to deploy all those things free?
Upvotes: 1
Views: 4833
Reputation: 19
If you're considering deploying on Netlify, it's important to note that hosting an Express server or a MongoDB instance for the backend on Netlify is not supported. In their official documentation, they explicitly mention,
"To deploy the frontend website it should just be a matter of hooking up the repository and configuring the build settings.
For your backend you won’t be able to host an express server with Netlify, nor a MongoDB instance so you’ll need to look elsewhere for the hosting requirements of the backend website, (for example Heroku), if you don’t plan on changing it."
Upvotes: 0
Reputation: 6702
You can split up your code so the static assets are hosted on Netlify, and the express server is hosted on heroku, which overall is simpler but you'll have to make sure all the URLs are pointing in the right place.
Alternatively, you can refactor your express rest API so that it runs via Netlify's functions, which are a nicer overlay on AWS lambda functions. See their docs here for a tutorial on how to do that.
Upvotes: 1