2020-11-29 22:31:03 +01:00
|
|
|
import os
|
|
|
|
|
|
|
|
from app_instance import api
|
|
|
|
|
|
|
|
|
|
|
|
@api.route("/js-cardgame/{file}")
|
|
|
|
def css(req, resp, file):
|
|
|
|
resp.headers['Content-Type'] = 'application/javascript'
|
|
|
|
full_file = os.path.join(
|
|
|
|
os.path.dirname(__file__),
|
|
|
|
'..',
|
|
|
|
'js-cardgame',
|
|
|
|
file
|
|
|
|
)
|
|
|
|
with open(full_file, encoding='utf-8') as fin:
|
|
|
|
resp.content = fin.read()
|
|
|
|
|
2020-11-30 23:16:05 +01:00
|
|
|
@api.route("/js-cardgame/deck/{file}")
|
|
|
|
def css(req, resp, file):
|
|
|
|
resp.headers['Content-Type'] = 'image/jpeg'
|
|
|
|
full_file = os.path.join(
|
|
|
|
os.path.dirname(__file__),
|
|
|
|
'..',
|
|
|
|
'deck/',
|
|
|
|
file
|
|
|
|
)
|
|
|
|
with open(full_file, 'rb') as fin:
|
|
|
|
resp.content = fin.read()
|
|
|
|
|
|
|
|
|
2020-11-29 22:31:03 +01:00
|
|
|
@api.route("/js-cardgame/js/{file}")
|
|
|
|
def css(req, resp, file):
|
|
|
|
resp.headers['Content-Type'] = 'application/javascript'
|
|
|
|
full_file = os.path.join(
|
|
|
|
os.path.dirname(__file__),
|
|
|
|
'..',
|
|
|
|
'js-cardgame',
|
|
|
|
'js',
|
|
|
|
file
|
|
|
|
)
|
|
|
|
with open(full_file, encoding='utf-8') as fin:
|
|
|
|
resp.content = fin.read()
|