Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
NixonXC authored Feb 26, 2022
0 parents commit b080a3b
Show file tree
Hide file tree
Showing 2 changed files with 517 additions and 0 deletions.
17 changes: 17 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from flask import Flask
import json, time
import random

app = Flask(__name__)

@app.route('/', methods=['GET'])
def home_page():
lines = open('que.txt').read().splitlines()
que = random.choice(lines)
result = que[4:]
data_set ={'question':result, 'datetime':time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())}
json_dump = json.dumps(data_set)
return json_dump

if __name__ == '__main__':
app.run(debug=True, port='3000', host='0.0.0.0')
Loading

0 comments on commit b080a3b

Please sign in to comment.