LS_Technologies / app.py
ministerchief's picture
Update app.py
1422cb3 verified
Raw
History Blame Contribute Delete
792 Bytes
import os
from flask import Flask, render_template, request, jsonify
# Gets the absolute path of the directory containing app.py
base_dir = os.path.dirname(os.path.abspath(__file__))
app = Flask(
__name__,
template_folder=os.path.join(base_dir, 'templates'),
static_folder=os.path.join(base_dir, 'static')
)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/about')
def about():
return render_template('about.html')
@app.route('/services')
def services():
return render_template('services.html')
@app.route('/contact')
def contact():
return render_template('contact.html')
import os
if __name__ == "__main__":
port = int(os.environ.get("PORT", 7860))
app.run(host="0.0.0.0", port=port)