Skip to content

Commit

Permalink
Merge pull request #83 from 6Coders/fix-upload-folder
Browse files Browse the repository at this point in the history
chore: Update CORS configuration in main.py
  • Loading branch information
ylovato01 authored May 15, 2024
2 parents 02b36f2 + 995fb53 commit 8b404bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
- Clonare la repository
- Tramite Command Shell posizionarsi nel percorso ./backend
- Installare le dipendeze con il comando:
- **pip install -r ./requirements.txt**
``` pip install -r ./requirements.txt ```
- Avviare il backend con il comando:
- **python ./main.py**
``` python ./main.py ```

## Testing

Expand All @@ -17,4 +17,4 @@ Per eseguire l'analisi statica eseguire il comando:

Per eseguire i test di unità e di integrazione eseguire il comando:

- **python -m unittest discover -s .\tests**
``` python -m unittest discover -s ./tests ```
5 changes: 3 additions & 2 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

app = Flask(__name__, static_url_path='', template_folder='../frontend/src/views')

CORS(app, resources={r'/*': {'origins': '*'}}, supports_credentials=True)
CORS(app, resources={r'/*': {"origins": "*", "allow_headers": "*", "expose_headers": "*"}}, supports_credentials=True)

@app.route('/heartbeat')
def heartbeat():
Expand All @@ -35,6 +35,8 @@ def handle(e):

temp_dir = os.environ.get('TMP') or os.environ.get('TMPDIR') or os.getcwd()
Settings.folder = os.path.join(temp_dir, 'uploads')
os.makedirs(Settings.folder, exist_ok=True)


jsonRepository = JSONRepositoryAdapter()
managerService = JSONManagerService(jsonRepository)
Expand Down Expand Up @@ -77,4 +79,3 @@ def handle(e):
app.route('/generatePrompt', methods=["POST"]) (queryController.handle_prompt_generation)

app.run(port=8000, debug=True)

10 changes: 5 additions & 5 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
- Clonare la repository
- Tramite Command Shell posizionarsi nel percorso ./frontend
- Installare le dipendeze con il comando:
- **npm install**
``` npm install ```
- Avviare il frontend con il comando:
- **npm run serve**
``` npm run serve ```

La web application sarà visibile all'indirizzo visualizzato sul terminale tramite browser.
Per utilizzare le funzionalità dell'applicazione è necessario che il server sia in esecuzione
Expand All @@ -15,12 +15,12 @@ Per utilizzare le funzionalità dell'applicazione è necessario che il server si

Per eseguire l'analisi statica eseguire il comando:

- **npm run lint**
``` npm run lint ```

Per eseguire i test di unità e di integrazione eseguire il comando:

- **npx jest**
``` npx jest ```

Per eseguire i test di sistema eseguire il comando:

- **npx cypress run**
``` npx cypress run ```

0 comments on commit 8b404bf

Please sign in to comment.