Base de connaissances

World Icons > Languages > NodeJS

Publié le 27/01/2017

Logo PlanetHoster

Description

The Node.js option allows you to host your web applications using this language.

The World interface allows you to select your preffered language version.

Use

 

To reset your Node.js project, go to the "Configure application" option.

Select the version of Node JS, the folder you want to use for your site and the domain to use.

You can also specify a specific path if you use multiple languages on the same site. For example, you can enable Node.JS for domaine.com/api/ links only.

You can send your project Node JS FTP a result.

By default, the installer will set a base NodeJS application. You can replace it with your own no problem. However, it is mandatory to have a app.js file for the proper functioning of your site.

SSH

If you want to run npm commands or node commands in SSH, you have to go to the edit section to edit the boot command of NodeJS environment.

In SSH, run the specified command.

Once logged into SSH, you can install the packages using the command "npm install".

Modifications

For NodeJS applications, it is sometimes necessary to restart the node server to apply the changes to your files.

One option for doing this is available in the "Edit" section.

Logs

When creating a NodeJS application it's possible that you come across errors. To see all error logs from your application, you can use the "Errors" option located in your cPanel account. 

MySQL

When configuring a MySQL connection, please use the MySQL socket and not the port :

/var/lib/mysql/mysql.sock

If you have further questions about the use of this option, you can find more information in our knowledge base:

https://my.planethoster.net/knowledgebase

You can also open a post on our forum:

https://forums.planethoster.net/

If you still can not find the answer to your questions, do not hesitate to contact us by ticket from your member area, by phone or by chat

https://www.planethoster.net/en/Contact