I have a React Native app with ExpressJS backend and mySQL database. How do I host my server? I’m planning to have sort of like a demo app just for presentation.
I tried using Heroku but I find it too complicated. I was told to use a GoDaddy domain. How do I do this? What are my other alternatives.
Francis James Lagang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
To host your application into the server you can try with NodeJS, according to us NodeJS is the better one for ExpressJS to host.
Following are the basic steps to Host:
-
You have to install NodeJS on system
-
Clone Your project from github (npm install OR yarn install)
-
Install pm2 globally
npm install pm2 -g OR yarn global add pm2 -
Create ecoSystem.js file
module.exports = {
apps: [
{
name: “project_name”,
script: “Your server.js file path”,
error_file: “location where you put error log file”,
out_file: “location where you put out log file”,
log_file: “location where you put combine log file”,
watch: false, //If you want to watch log then you can set true
},
],
};
- Create sh file restartServer.sh
#!/bin/sh pm2 delete <project_name> && pm2 start ecosystem.config.js && pm2 logs <project_name>
- Go to project directory in command line and start pm2 server
sh restartServer.sh
1