separated http server setup from other code so that this module can be unit tested effectively