Basic nodejs, adapt code for nodejs