server compiles and main function runs