Intructions for using NodeJS 10 LTS on devweb2019:
- these instructions are for someone using linux in our labs
- visit https://devweb2019.cis.strath.ac.uk/username-nodejs/ - remember to replace username with your one
create your empty app directory in /home/username/DEVWEB/2019/nodejs - e.g. mkdir testapp
- this will give an proxy error but should create the nodejs setup required - the error occurs because you don't have a nodejs app yet
run 'npm10 init' in your empty app directory - e.g. cd testapp; npm10 init
- you should put the name of you empty app directory in a plain text file called NODEJS in /home/username/DEVWEB/2019/nodejs
run npm10 install to install required modules (while in your app directory) - e.g. npm10 install ionic express cordova
create your initial app
- answer the questions......
when you need to restart your node application just run 'touch /home/username/DEVWEB/2019/nodejs/NODEJS' and it should restart within 30 seconds
you can only have one nodejs app at a time
the docker container, running your nodejs app, will stop running after 30 minutes (from when it was first started). It will, of course, restart upon next access. If you would prefer the stopping to happen 30 minutes after last access then make your app log to any file in /home/username/DEVWEB/2019/.logs/nodejs.
NOTE: If you want to use NodeJS 12 then you must also create a file called NODEJSVERSION in /home/username/DEVWEB/2019/nodejs containing the number 12 only
- the app must be set to run on port 3000
- the packages.json file must refer to the main file correctly, e.g.
"main": "app.js",, otherwise the nodejs application will not start
- to view your app goto https://devweb2019.cis.strath.ac.uk/username-nodejs/
- you should also be able to test your app by running node locally - e.g. node10 testapp
- you can then browse to http://localhost:3000/ to view it.