-1

I would like to deploy my website that I've done following Lama Dev e-commerce MERN Stack tutorials, this is one of them: https://www.youtube.com/watch?v=rMiRZ1iRC0A&list=WL&index=24&t=6512s

I have Hostinger hosting and domain and I managed to deploy the client side, but the API is working only locally and I am not sure how to deploy it correctly to have the full functionality of the website publicly.

Apparently Hostinger shared hosting doesn't allow nodejs apis, so tried using render but it was also unsuccessful. What is a standard practice? I don't know much about server-side web development

Thank you in advance

Laura
  • 1

1 Answers1

0

It's not recommended to use Hostinger Shared Hosting to deploy your NodeJS application, but it is possible.

Refer to this answer below (it is quite complicated and should probably not be used if you can avoid it as there are better alternatives):

Run node.js on cpanel hosting server

You would be better using a service like Heroku (not free anymore I believe) to deploy your app or you can try using Railway if you are not comfortable with services like AWS or Aliyun.

https://railway.app

Railway is a very easy way to deploy NodeJS applications from the command line. You can start here: https://docs.railway.app/getting-started

To be able to deploy to your domain, you would need to add the nameservers (hosted on Hostinger from the domains tab I believe) from Railway (in the settings tab of your project on Railway) and attach the domain to your project. After you have done that, any time you want to deploy to the server, just run "railway up"

https://docs.railway.app/deploy/railway-up.

lwnsjdu
  • 68
  • 1
  • 3
  • 9
  • 1
    Thank you for your answer! I eventually managed to deploy my api for free using render following this tutorial so that works too: https://www.youtube.com/watch?v=68ubggfsQlE – Laura Mar 16 '23 at 15:06