mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 09:26:16 +00:00
flask allow all origin
This commit is contained in:
@@ -35,6 +35,7 @@ class ChargeControls:
|
||||
for vin, el in chd.items():
|
||||
charge_control_list.list[vin] = ChargeControl(psacc,vin,**el)
|
||||
return charge_control_list
|
||||
|
||||
def get(self,vin):
|
||||
try:
|
||||
return self.list[vin]
|
||||
|
||||
@@ -81,6 +81,12 @@ def charge_control():
|
||||
def get_recorded_position():
|
||||
return FlaskResponse(myp.get_recorded_position(), mimetype='application/json')
|
||||
|
||||
@app.after_request
|
||||
def after_request(response):
|
||||
header = response.headers
|
||||
header['Access-Control-Allow-Origin'] = '*'
|
||||
return response
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-f", "--config", help="config file", type=argparse.FileType('r'))
|
||||
|
||||
Reference in New Issue
Block a user