You are here:
< Back

The NodeJS engine is running on your server behind our other services. It is published so not only our devices can access it’s services but anyone who has the link.

Using our template package

Our template package contains:

  • Instagram, facebook, feedly connectors
  • Instagram, facebook, feedly widgets
  • Serving static files
  • Databese connector sample

You can find more information here.

Creating your own application

If you want to create your own NodeJs application there is a few things you need to be awer of.

Your main NodeJs application file must be called index.js
Also your package.json should start and watch your application in these formats:

“start”: “node index”,
“watch”: “node index”

We have environment variables set up, that you can reach with process.env.{variable} inside your NodeJs script.

Such variables are:

  • URL = The base URL where you can reach your NodeJs application
  • PORT = The port where your NodeJs application runs.
  • DEBUG= ‘*‘ indicates wether your application is running in debug mode or not.

Uploading your application to your server

Copy your files to the /srv/docker/nodejs/localscripts folder on your server.

The service will automatically create the node_modules folder and the package-lock.json file if you have the dependencies set up in your package.json file, so there is no need to copy them.
The NodeJs environment automatically restarts when it detects change in a file.

How to reach your endpoints

If your server has a domain and a valid certificate:
https://{yourdomain}/localscripts/{yourendpoint}

If you have a local server without domain:
http://{yourServer’sIpAddress}:{port}/{yourendpoint}



Comments are closed.