created a new file app.js, included the script in the index template, and tidied the server.js file