Move app client js code to separate file