You are here:
< Back

With our NodeJs application management system, you have the option to create, upload and run your own nodeJs applications on your server.

When uploading the application you have the option to load the config found in the configuration file or overwrite it.

The module should be a .zip compressed file with the following structure:

|—-config //folder contains the configuration file and the images
|     |—-config.json
|     |—-icon.png
|     |__placeholder.png
|
|—-index.js //your main starting nodeJs application file
|__package.json //with the necessary npm packages listed in it

Please do not include the node_modules folder and the package-lock.json file, the system will install the necessary modules automatically.

Please also do not include any other files on any other folder level named the same as one of the required files, but any other file or folder can be included.

The configuration JSON file has to contain:
{
    “name“: {{name_of_the_module, has to be unique}},
    “max_memory_restart“: {{The maximum memory usage of the module, like: “100M” for 100 megabites}},
    “description“: {{the description of the module}},
    “query_params“: {{the query parameters of the module separated with “,” if it has any, like: “arg1, arg2“}},
    “absolute_path“: {{the main route of the application if it has one, like: “/test“}}
}

 

The icon and the placeholder image has to be .png image file.

 

The system will automatically assign a PORT number for each module in its environment, this port can change dynamically with every restart.
If your application has web service functionality you need to run it on the PORT read from the environment variable, process.env.PORT .

Example:

var http = require(‘http’);

http.createServer(function (req, res) {
res.writeHead(200, {‘Content-Type’‘text/plain’});
res.end(‘Hello World!’);
}).listen(process.env.PORT);

You can download a sample module here.