Extracted app creation from server.js