Reformatted code, also moved the cookie authentication into the server.js so it is not redundant and can be shared easier, might move it into the router and fuse the viewer with requesthandler