Parcourir la source

Define robots.txt as a static file

Baptiste Jonglez il y a 10 ans
Parent
commit
535e7d1b47
2 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 1 1
      peerfinder.py
  2. 3 0
      static/robots.txt

+ 1 - 1
peerfinder.py

@@ -163,7 +163,7 @@ def homepage():
 
 @app.route('/robots.txt')
 def robots():
-    return "User-agent: *\nDisallow: /target/\nDisallow: /result/"
+    return app.send_static_file("robots.txt")
 
 @app.route('/submit', methods=['POST'])
 def submit_job():

+ 3 - 0
static/robots.txt

@@ -0,0 +1,3 @@
+User-agent: *
+Disallow: /target/
+Disallow: /result/