Skip to content

Commit

Permalink
Succeded serving the css & js files
Browse files Browse the repository at this point in the history
  • Loading branch information
tabitapetruneac committed Sep 18, 2024
1 parent 126243a commit 786f61e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bff/app/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Flask, abort, jsonify, render_template, request
from flask import Flask, abort, jsonify, render_template, send_from_directory, request
import requests, json, argparse, os

print("Start")
Expand All @@ -15,7 +15,6 @@

app = Flask(__name__, template_folder='../templates')


@app.route('/', methods=['GET'])
def home():
print("Sunt in /")
Expand Down Expand Up @@ -133,6 +132,13 @@ def delete_user():
return jsonify({'error': 'User deletion failed', 'details': str(req_err)}), 500
return jsonify({'message': f'User {user_id} delete successfully'}), 200

@app.route('/styles/<path:filename>')
def serve_css(filename):
return send_from_directory(os.path.join(app.root_path, '../static/styles'), filename)

@app.route('/js/<path:filename>')
def serve_js(filename):
return send_from_directory(os.path.join(app.root_path, '../static/js'), filename)

if __name__=='__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
Expand Down

0 comments on commit 786f61e

Please sign in to comment.