Skip to content

Commit d3fc55b

Browse files
authored
Merge pull request #24 from ComputerScienceHouse/cinnamon
Added robots.txt, sitemap.xml, favicon.ico
2 parents d1c638d + 3a6aed6 commit d3fc55b

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

src/app.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ def deleteGame(id):
8484
return "<p>Stop hacking</p>"
8585
return flask.redirect('/catalog')
8686

87+
@app.route("/sitemap.xml")
88+
@app.route("/robots.txt")
89+
@app.route("/favicon.ico")
90+
def static_from_root():
91+
return flask.send_from_directory(app.static_folder, flask.request.path[1:])
92+
8793
@app.errorhandler(Exception)
8894
def page404(e):
8995
eCode = 500
@@ -93,9 +99,7 @@ def page404(e):
9399
message = e.description
94100
eCode = e.code
95101
finally:
96-
return flask.render_template('error.html', error=eCode, message=message)
102+
return flask.render_template('error.html', error=eCode, message=message), eCode
97103

98104
if __name__ == '__main__':
99105
app.run(host='localhost', debug=True)
100-
101-

src/static/robots.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow: /404/
4+
Sitemap: https://devcade.csh.rit.edu/sitemap.xml

src/static/sitemap.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<url>
4+
<loc>https://devcade.csh.rit.edu</loc>
5+
<loc>https://devcade.csh.rit.edu/catalog</loc>
6+
<lastmod>2023-02-22</lastmod>
7+
</url>
8+
</urlset>

0 commit comments

Comments
 (0)