-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathreadinput.py
More file actions
25 lines (21 loc) · 760 Bytes
/
readinput.py
File metadata and controls
25 lines (21 loc) · 760 Bytes
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
from flask import Flask, render_template, redirect, url_for,request
from flask import make_response
app = Flask(fullxtest)
@app.route("/")
def home():
return "hi"
@app.route("/index")
@app.route('/login', methods=['GET', 'POST'])
def login():
message = None
if request.method == 'POST':
datafromjs = request.form['mydata']
result = "return this"
resp = make_response('{"response": '+result+'}')
resp.headers['Content-Type'] = "application/json"
return resp
return render_template('login.html', message='')
if __name__ == "__main__":
app.run(debug = True)
# (fullXtest) readinput.py - python code to read input <hostname> from javascript web app and pass to fullXtest.py
# by 404TeamNotFound