rewrite to nodejs app