Skip to content

Commit

Permalink
Merge pull request #204 from Happilands/patch-1
Browse files Browse the repository at this point in the history
Add robots.txt file
  • Loading branch information
redfast00 authored Apr 22, 2023
2 parents 02afba7 + e86fce0 commit cdca564
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from admin import init_admin
from config import Configuration
from flask import Flask, render_template
from flask import Flask, render_template, Response
from flask_bootstrap import Bootstrap, StaticCDN
from flask_debugtoolbar import DebugToolbarExtension
from flask_login import LoginManager
Expand Down Expand Up @@ -161,6 +161,12 @@ def create_app():
"""Initializer for the Flask app object"""
app = Flask(__name__)

@app.route('/robots.txt')
def noindex():
r = Response(response="User-Agent: *\nDisallow: /\n", status=200, mimetype="text/plain")
r.headers["Content-Type"] = "text/plain; charset=utf-8"
return r

# Load the config file
app.config.from_object("config.Configuration")

Expand Down

0 comments on commit cdca564

Please sign in to comment.