getting static files and return content mime types Args: path: path and filename Returns: file content and content type if file found otherwise abort(404)
(path)
| 232 | @app.route("/", defaults={"path": ""}) |
| 233 | @app.route("/<path:path>") |
| 234 | def get_static_files(path): |
| 235 | """ |
| 236 | getting static files and return content mime types |
| 237 | |
| 238 | Args: |
| 239 | path: path and filename |
| 240 | |
| 241 | Returns: |
| 242 | file content and content type if file found otherwise abort(404) |
| 243 | """ |
| 244 | static_types = all_mime_types() |
| 245 | return Response( |
| 246 | get_file( |
| 247 | os.path.join( |
| 248 | root_dir(), |
| 249 | path |
| 250 | ) |
| 251 | ), |
| 252 | mimetype=static_types.get( |
| 253 | os.path.splitext(path)[1], |
| 254 | "text/html" |
| 255 | ) |
| 256 | ) |
| 257 | |
| 258 | |
| 259 | @app.route("/api/events/count/<event_type>", methods=["GET"]) |
nothing calls this directly
no test coverage detected