Refactor the commonJS code and implement the webserver command for nodejs.