Move server code to app folder