add the basic API file
This commit is contained in:
parent
c78632d046
commit
8915f7794d
|
@ -0,0 +1,22 @@
|
||||||
|
# importing the flask library files
|
||||||
|
from flask import Flask
|
||||||
|
from flask import abort
|
||||||
|
|
||||||
|
from .pdf import PDF
|
||||||
|
|
||||||
|
#create flask web app object
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
# define http route
|
||||||
|
@app.route("/")
|
||||||
|
def index():
|
||||||
|
pdf = PDF('/home/andreas/split_pdf/')
|
||||||
|
try:
|
||||||
|
pdf.split()
|
||||||
|
return 200
|
||||||
|
except Exception as e:
|
||||||
|
return abort(500)
|
||||||
|
|
||||||
|
#run the app
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run()
|
Reference in New Issue