[Labs-l] Node.js updates

Jan Lebert jan.lebert at online.de
Fri Apr 17 17:50:15 UTC 2015


On 04/17/2015 07:42 PM, Ricordisamoa wrote:
>
> It works by putting
>
> "scripts": {
>      "start": "~/.nvm/versions/node/v0.12.2/bin/node server.js"
> }
>
> in ~/www/js/package.json. It looks a bit hackish though...
> and nvm does not work in "start".
>

You can also use the portgrabber command [1] if you want to use a 
nonstandard webserver(version). You'll need two scripts:

httpserver.sh
====
#!/bin/bash
exec portgrabber jshint wrapper.sh
====

wrapper.sh
=====
#!/bin/bash
export TOOL_WEB_PORT=$1
source ~/.nvm/nvm.sh
nvm exec 0.12.2 node ~/www/js/server.js
=====

and start it with

jstart -q webgrid-generic -l release=trusty -mem 4G httpserver.sh

Best wishes,
sitic

[1] 
https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/Web#Other_web_servers



More information about the Labs-l mailing list