INNER CODE UNIT · Python

swagger_ui_directory

giuseppe99barchetta/SuggestArr · api_service/app.py:197

    def swagger_ui_directory():
        packaged = os.path.join(application.static_folder, 'swagger-ui')
        if os.path.isdir(packaged):
            return packaged
        return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'client', 'node_modules', 'swagger-ui-dist'))

    @application.route('/swagger-ui/<path:filename>')
    def swagger_ui_asset(filename):
        return send_from_directory(swagger_ui_directory(), filename)

    @application.route('/swagger-ui/custom/<path:filename>')
    def swagger_custom_asset(filename):
        packaged = os.path.join(application.static_folder, 'swagger')
        source = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'client', 'public', 'swagger'))
        return send_from_directory(source if os.path.isdir(source) else packaged, filename)

    @application.route('/swagger-ui/logo')
    def swagger_logo():

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…