forked from RavicharanN/Catalyst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
36 lines (30 loc) · 1002 Bytes
/
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
from flask import Flask,render_template,url_for,redirect,request
from send import send
from receive import receive
app = Flask(__name__)
@app.route('/success/<message>')
def success(message):
return render_template('success.html',message = message)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/sender',methods=['POST','GET'])
def sender():
if request.method == "GET":
return render_template('sender.html')
else:
path = request.form['path']
send(path,9999)
message = "SentSuccessfully"
return redirect(url_for('success',message = message))
@app.route('/receiver', methods = ['POST','GET'])
def receiver():
if request.method == "GET":
return render_template('receiver.html')
else:
ip = request.form['ip']
receive(ip,9999)
message = "ReceivedSuccessfully"
return redirect(url_for('success',message = message))
if __name__ == "__main__":
app.run(debug=True)