-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
54 lines (41 loc) · 1.32 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from flask import Flask, redirect, make_response, request, render_template, send_from_directory
from flask_mail import Mail, Message
from flask_minify import minify
import random, string
app = Flask(__name__)
minify(app=app, html=True, js=True, cssless=True)
@app.errorhandler(404)
def page_not_found(e):
return render_template("404.html"), 404
@app.route("/")
def home():
return render_template('home.html')
@app.route("/page/<path:path>")
def send_page(path):
return render_template(path+".html")
@app.route("/enemy/")
def send_enemy():
return render_template("battle_screen.html")
@app.route('/js/<path:path>')
def send_js(path):
return send_from_directory('js', path)
@app.route('/css/<path:path>')
def send_css(path):
return send_from_directory('css', path)
@app.route('/img/<path:path>')
def send_img(path):
return send_from_directory('img', path)
@app.route('/checkword/<path:path>')
def check_word(path):
if '*'+str(path.upper())+'*' in open('wordlists/wordlist.txt').read():
return 't';
else:
return 'f';
@app.route('/specialword/<path:path>/<path:word>')
def check_specialword(path,word):
if '*'+str(word.upper())+'*' in open('wordlists/wordlist_'+str(path)+'.txt').read():
return 't';
else:
return 'f';
if __name__ == '__main__':
app.run(debug=True, use_reloader=False, port=3001)