diff --git a/Readme.md b/Readme.md index c37226f..dd11cb6 100644 --- a/Readme.md +++ b/Readme.md @@ -24,7 +24,7 @@ docker build -t cirici/wkhtmltopdf-aas . ## Starting Docker container ```bash -docker run -d --name wkhtmltopdf-aas -p :5000 cirici/wkhtmltopdf-aas +docker run -d --name wkhtmltopdf-aas -p :80 cirici/wkhtmltopdf-aas ``` ## Testing the microservice diff --git a/app.py b/app.py index 4d31e5f..31ad0b7 100644 --- a/app.py +++ b/app.py @@ -39,6 +39,10 @@ def handle_request(config): print("URL provided: " + request.form['url']) pdf = pdfkit.from_url(str(request.form['url']), output_path=False, configuration=config, options=options) + if ('html' in request.form): + print("Html provided") + pdf = pdfkit.from_string(str(request.form['html']), output_path=False, configuration=config, options=options) + # If we are receiving the html contents from a uploaded file elif ('content' in request.files): print("File provided: " + str(request.files['content']))