Skip to content

Commit

Permalink
Merge pull request #85 from unb-mds/83/config-integration-front-back
Browse files Browse the repository at this point in the history
83/config integration front back
  • Loading branch information
anaelisaramos authored Dec 2, 2024
2 parents 7e1a915 + fb97601 commit c098c03
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 1 deletion.
6 changes: 6 additions & 0 deletions API/AcheiUnB/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@
"allauth.socialaccount.providers.microsoft",
"users",
"django_extensions",
"corsheaders"
]

MIDDLEWARE = [
"corsheaders.middleware.CorsMiddleware",
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
Expand Down Expand Up @@ -179,3 +181,7 @@
LOGOUT_REDIRECT_URL = ""
MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"
LANGUAGE_CODE = "pt-br"

CORS_ALLOWED_ORIGINS = [
'http://localhost:5173',
]
3 changes: 2 additions & 1 deletion API/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ urllib3==2.2.3
Pillow
djangorestframework
django-extensions
djangorestframework-simplejwt
djangorestframework-simplejwt
django-cors-headers==4.6.0
91 changes: 91 additions & 0 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.7.8",
"vue": "^3.5.12",
"vue-router": "^4.4.5"
},
Expand Down
8 changes: 8 additions & 0 deletions web/src/services/axios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import axios from "axios";

axios.defaults.baseURL = "http://localhost:8000/api";
axios.defaults.timeout = 10000;
axios.defaults.headers["Content-Type"] = "application/json";
axios.defaults.headers["Accept"] = "application/json";

export default axios;

0 comments on commit c098c03

Please sign in to comment.