Skip to content

Commit

Permalink
Add route for serving static assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Taylor Yates committed Jun 23, 2020
1 parent 5e70082 commit 90a4bd4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from datetime import datetime, date
from random import sample
from flask import request, jsonify, render_template, Flask
from flask import request, jsonify, render_template, Flask, current_app
from flask_cors import CORS
from utility import parse_apod, get_concepts
import logging
Expand Down Expand Up @@ -223,6 +223,11 @@ def home():
methodname=APOD_METHOD_NAME,
usage=_usage(joinstr='", "', prestr='"') + '"')

@application.route('/static/<asset_path>')
def serve_static(asset_path):
print(asset_path)
return current_app.send_static_file(asset_path)


@application.route('/' + SERVICE_VERSION + '/' + APOD_METHOD_NAME + '/', methods=['GET'])
def apod():
Expand Down

0 comments on commit 90a4bd4

Please sign in to comment.