connect to localhost if served from a file.
serve everything using express.
dynamically connect to the host it's deployed on.