Defalt-404 commited on
Commit
06af17c
1 Parent(s): 66690fd
Files changed (1) hide show
  1. server.py +3 -14
server.py CHANGED
@@ -5,21 +5,14 @@ import requests
5
  import os
6
  import tempfile
7
 
8
- def get_secrets(file):
9
- file_path = f'/run/secrets/{file}'
10
- print('in get_secrets function')
11
-
12
- with open(file_path, 'r') as file:
13
- secret_example = file.read()
14
- print('The content of SECRET_EXAMPLE is:', secret_example)
15
- return secret_example
16
 
17
  def create_app():
18
  app = Flask(__name__)
19
  app.config['SESSION_COOKIE_SECURE'] = True # Requires HTTPS
20
  app.config['SESSION_COOKIE_SAMESITE'] = 'None'
21
- app.secret_key = get_secrets('secret_key')
22
  return app
 
23
  app = create_app()
24
 
25
 
@@ -47,11 +40,7 @@ def page_not_found(error):
47
  # Route to display transformed CSV as a table
48
  @app.route('/')
49
  def display_transformed_csv():
50
- app = create_app()
51
- app.secret_key = get_secrets('secret_key')
52
- access_token = get_secrets('GH_token')
53
- app.secret_key = get_secrets('secret_key')
54
- print(access_token)
55
  benchmark_file_texteval = 'Miner_Benchmark.csv'
56
  benchmark_file_agieval = 'miner_benchmark_AGIEval.csv'
57
  benchmark_file = ''
 
5
  import os
6
  import tempfile
7
 
 
 
 
 
 
 
 
 
8
 
9
  def create_app():
10
  app = Flask(__name__)
11
  app.config['SESSION_COOKIE_SECURE'] = True # Requires HTTPS
12
  app.config['SESSION_COOKIE_SAMESITE'] = 'None'
13
+ app.secret_key = os.environ.get('secret_key')
14
  return app
15
+
16
  app = create_app()
17
 
18
 
 
40
  # Route to display transformed CSV as a table
41
  @app.route('/')
42
  def display_transformed_csv():
43
+ access_token = os.environ.get('GH_token')
 
 
 
 
44
  benchmark_file_texteval = 'Miner_Benchmark.csv'
45
  benchmark_file_agieval = 'miner_benchmark_AGIEval.csv'
46
  benchmark_file = ''