Files
eamco_office_api/app/main/views.py
2026-01-28 21:55:10 -05:00

29 lines
803 B
Python
Executable File

import logging
from flask import jsonify, Response, url_for
from app import app
logger = logging.getLogger(__name__)
@app.route("/favicon.ico")
def favicon():
logger.info("GET /favicon.ico - Serving favicon")
return url_for('static', filename='data:,')
@app.route('/robots.txt')
@app.route('/sitemap.xml')
def static_from_root():
logger.info("GET /robots.txt or /sitemap.xml - Serving robots/sitemap")
def disallow(string): return 'Disallow: {0}'.format(string)
return Response("User-agent: *\n{0}\n".format("\n".join([
disallow('/bin/*'),
disallow('/admin'),
])))
@app.route('/index', methods=['GET'])
@app.route('/', methods=['GET'])
def index():
logger.info("GET / or /index - API health check")
return jsonify({"success": "Api is online"}), 200