format response properly

This commit is contained in:
rasmus 2020-12-23 10:31:32 +02:00
parent f034197eca
commit deca9d1275
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ export FLASK_ENV=development
export FLASK_APP=prom.py
flask run
"""
from flask import Flask, request # General flask, and the handle requests on the fly thing.
from flask import Flask, Response, request # General flask, and the handle requests on the fly thing.
import os # for ENV arguments
import scraperMain, prom_servers
@ -31,4 +31,4 @@ def parse_request(): # If somebody accesses us
response_list = prom_servers.prom_servers(PREFIX, data[0], data[1]) # Convert our python lists to prometheus format whatever.
response = '\n'.join(response_list) # Oh you still don't want a list? Fine, newlines!
return '<pre>' + response + '</pre>' # The pizza is already cold.
return Response(response + '\n', mimetype='text/plain') # The pizza is already cold.