36 lines
677 B
Python
36 lines
677 B
Python
import os
|
|
import pprint
|
|
import re
|
|
##
|
|
from flask import render_template, make_response, request, Response
|
|
from flask_autoindex import AutoIndex
|
|
##
|
|
from app import db
|
|
from app import app
|
|
|
|
ua_re = re.compile(r'^iPXE/v[0-9.]+')
|
|
|
|
|
|
def getReqInfo():
|
|
d = {}
|
|
for a in dir(request):
|
|
if a.startswith('_'):
|
|
continue
|
|
d[a] = getattr(request, a)
|
|
return(d)
|
|
|
|
|
|
@app.route('/', methods = ['GET'])
|
|
def index():
|
|
DB = db.LocalDB()
|
|
result = render_template('main.ipxe.j2',
|
|
db = DB)
|
|
DB.close()
|
|
return(result)
|
|
|
|
|
|
@app.route('/foo', methods = ['GET'])
|
|
def foo():
|
|
pprint.pprint(getReqInfo())
|
|
return(Response())
|