def ember_app(path=None):
 ember_app_folder = None
 fp = (path or 'index.html')
 for k in settings.EXTERNAL_EMBER_APPS.keys():
  if request.path.strip('/').startswith(k):
   ember_app_folder = os.path.abspath(os.path.join(os.getcwd(), settings.EXTERNAL_EMBER_APPS[k]['path']))
   break
 if (not ember_app_folder):
  raise HTTPError(http.NOT_FOUND)
 if (not os.path.abspath(os.path.join(ember_app_folder, fp)).startswith(ember_app_folder)):
  raise HTTPError(http.NOT_FOUND)
 if (not os.path.isfile(os.path.join(ember_app_folder, fp))):
  fp = 'index.html'
 return send_from_directory(ember_app_folder, fp)

def ember_app ( path = None ) : ember_app_folder = None fp = ( path or 'index.html' ) for k in settings . EXTERNAL_EMBER_APPS . keys ( ) : if request . path . strip ( '/' ) . startswith ( k ) : ember_app_folder = os . path . abspath ( os . path . join ( os . getcwd ( ) , settings . EXTERNAL_EMBER_APPS [ k ] [ 'path' ] ) ) break if ( not ember_app_folder ) : raise HTTPError ( http . NOT_FOUND ) if ( not os . path . abspath ( os . path . join ( ember_app_folder , fp ) ) . startswith ( ember_app_folder ) ) : raise HTTPError ( http . NOT_FOUND ) if ( not os . path . isfile ( os . path . join ( ember_app_folder , fp ) ) ) : fp = 'index.html' return send_from_directory ( ember_app_folder , fp )
serve the contents of the ember application .