How do I host my webapp (made using HTML, CSS, JS, node and express) on GoDaddy hosting (cPanel)? I've already purchased a domain and hosting at it, - dns

I've already made a webapp using HTML, CSS, JS, node and express. Now I want to host it on GoDaddy. I've already purchased its domain and hosting. But the only option i'm observing frequently says WORDPRESS hosting (i'm assuming it says to build website on wordpress which I don't want to). I have the access to its cPanel but IDK how to use it (properly).

In order to host your site, you just need to upload all your files via FTP to your root folder. From your explanation above, it should be basic website. You can just upload your files to your root folder. If you encounter issue, you can contact their support team.

Related

How does hosting a website work when using a Backend/Database?

I have hosted static sites before and here;s how it worked:
I have my HTML, CSS, JavaScript files ready
I upload them to a hosting site
and the website goes up
But now I'm starting to work on backend development with Nodejs and using Mongodb for databases.
I'm currently running my Mongodb database on a localhost.
Do I follow the same procedure as before when trying to host the site, or is there something I have to do differently?
(I figured It's different, but I don't know how to approach it)

How do I properly upload a localhost website online?

I have a ReactJS project for my Front and a NodeJS project/server using Express for my back. My Front depends on my Back because for example in the Login part, I ask the server if the user is already in our database.
To execute my project, I just open 2 terminals and do npm start in each Front and Back.
I know that in order to upload a website with a personal domain name, I should:
Buy a domain name
Pay a subscription to a web-hosting website like GoDaddy, Bluehost, Hostgator etc.
If I pay a subscription to some web-hosting website, will I be able to put my Front AND Back? I have seen some tutorials online and people just make a simple HTML/CSS/JS website and upload it. I never see anyone uploading their own Server and making requests to it.
I'm not asking to merge both my Front and Back. I want to know how do people upload online their React front and Node Server online, for them to be always executed and talking to each other. I just can't see the relationship and explanation on how uploading both.
Your react frontend doesn't really need a server, you'd need to build a release bundle and that can be served from any static filehoster. For your backend though you need a node.js hoster like AWS or heroku, follow their tutorials to upload your project.
You could also then serve both from the same hoster and read into connecting frontend and backend like mentioned by #FedeSc
An easy solution for your use case could be digitalocean or any similar site that offers a whole virtual system to operate with. You can then ssh into the server as it was your computer and use the terminal there. It is cheaper than Heroku if you wish to make your site available without 30 seconds waiting time (that is what Heroku does in a serverless fashion if you are on a free plan). There are dozens of sites like this but I had good experience with digitalocean and a basic plan is $5/mo.

How to publish and host MEAN stack project in GitHub

How to host AngularJS, MonogDB, Node.js, ExpressJS project on GitHub?
I have uploaded normally like a static HTML page but it didn't work.
How to host this project as it consists of four technologies
You can't host a MEAN stack site on GitHub Pages:
GitHub Pages is a static site hosting service and doesn't support server-side code such as, PHP, Ruby, or Python.
Similarly, GitHub Pages doesn't support Node.js or MongoDB.
Since github pages host only static resources like html, css and javascript you cannot host a node application there. You could try hosting your project on Digital Ocean, Heroku, AWS etc. These provides free trials versions as well. Here you can set up your own server and get things working.

Running angular2 on hostgator (or any host)

I have started getting into angular2 recently and have previously used angularjs. This might seem like a very broad question but all of the tutorials show how to use angular2 on a local environment and show how to serve the app and navigate to localhost:3000 etc. So my question is how do I go about running my app on my hosted server. Like how do I get it to go to my app using www.mysite.com? Do I copy the files to my public_html directory or do I have do do something to make my domain go to the port the app is being served on? Or do I have to turn off apache and do something to use node instead? Any help would be apreciated.
is very simple:
Copy local files into remote folder
Execute ng build --prod
your domain root route should be myremoteFolder/dist
hope this help you
Angular is a frontend framework, which means it runs entirely in the browser. This means it's files are "static", they don't require a web server to dynamically process the way PHP files would. This means they can be hosted anywhere static files can be hosted such as AWS S3 or whatever directory you'd put your images and stylesheets on HostGator.
I'm assuming the localhost:3000 is a simple development server used for local testing. If it does more work than that, such as expose API endpoints that your Angular app calls to, then you'll need to find a host that can run NodeJS applications.

Hosting my MEAN stack web app on github pages

I have a project here that is on github. I created a gh-pages branch to make it hosted on github pages. The link they gave me to my hosted site is here.
I am pretty new to web apps and especially new to MEAN stack web apps. My question is - how can I access my web app now that it is hosted via github? Obviously the hosted link gives a 404 error because I don't have an index.html file in the root of the project. The "html" I have in the project is in the views folder and has an "ejs" file extension (index.ejs).
To run this app on my local machine I start an npm server:
npm start
Then I navigate to http://localhost:3000/#/home in a browser to see the app.
Is it even possible to host this app on github pages? Do I need to modify my project in some way to make it work? Also - I know I will have to change the mongoose database pointer for the database portion to work. Any pointers in the right direction would be greatly appreciated!
Github does not host nodejs instances.
If you want to host a it on GitHub pages you can follow these steps:
Separate Angular front end with node back end API.
Host your Angular front end to GitHub pages.
Then host your node back end to some cloud hosting. Make sure you have CORS enabled. It will work as a REST API.
Now use the REST API end points to wire up the the whole app.

Resources