Improvements: server automatically shuts down when user navigates away from webpage/app. Server listens on 127.0.0.1 only.