Skip to content

Commit

Permalink
Used .env for endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreSkin committed Feb 20, 2024
1 parent 63bd5e8 commit 5dbeca3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Interface/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@
from flask import Flask, render_template, request, jsonify
import requests
import json
import os
from dotenv import load_dotenv

# Carica le variabili di ambiente dal file .env
dotenv_path = os.path.join(os.path.dirname(__file__), '../.env')
if os.path.exists(dotenv_path):
load_dotenv(dotenv_path)

app = Flask(__name__)

# Define the endpoint URL
endpoint = 'http://localhost:3030/DDRUM/query'
# Leggi l'endpoint dall'ambiente
endpoint = os.getenv('ENDPOINT')

@app.route('/')
def index():
Expand Down

0 comments on commit 5dbeca3

Please sign in to comment.