Update server.js

Fix a bug in getting the URL