Answer the question
In order to leave comments, you need to log in
How to push node to hosting?
Let's say there is a ready-made application. It runs fine through the terminal "node something there.js", but how to hang it on the hosting? After all, there are neither html nor php files, and the js file cannot be opened just like that. So I'm very interested in how to make it work on hosting.
I immediately apologize for such a question, I understand that there is most likely a lot of information on Google about this, but I searched for this for about 15 minutes, and did not find specific answers. Probably I'm not asking the right question.
Answer the question
In order to leave comments, you need to log in
On shared hosting with php - no way. It is best to take an inexpensive vps. As cliche as it sounds, I would recommend DigitalOcean.
On Centos, for example: https://www.digitalocean.com/community/tutorials/h... . Pretty much the same for the rest. In general, on the request how to install nodejs centos/ubuntu ... everything is googled.
Buy node hosting and not php, it's stupid to buy chocolate and be surprised that it's not meat.
Put this in package.json.
"scripts": {
"start": "server.js"
},
app.get('/', function (req, res) {
res.render(__dirname + '/client/views/index');
});
http.listen(process.env.PORT || 80);
You can start the server by making a package.json similar to what is used in angular-seed :
{
...
"scripts": {
...
"start": "http-server -a localhost -p 8000 -c-1",
...
}
...
}
You can try the Last.Backend service. Using the constructor, visually create the necessary infrastructure... Everything is described in detail in the User Guide, just using the example of deploying a node.js application. Project site http://lastbackend.com, User Guide - docs.lastbackend.com/guide.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question