If the server should not pause when the app is in the background, set keepAlive to true

let server =newStaticServer({keepAlive :true });

Passing 0 as the port number will cause a random port to be assigned every time the server starts.
It will reset to a new random port each time the server unpauses, so this should only be used with keepAlive.