Skip to content

Commit 2c62442

Browse files
committed
cors issue
1 parent bfd90e7 commit 2c62442

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

backend/core/views.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1-
from rest_framework.views import APIView
21
from rest_framework.response import Response
2+
from core.db import db
33

44
class HomeView(APIView):
55
def get(self, request):
6+
db_status = "Connected"
7+
try:
8+
# Ping the database to check connectivity
9+
db.command('ping')
10+
except Exception:
11+
db_status = "Disconnected"
12+
613
return Response({
7-
"message": "Welcome to HRMS Lite API",
8-
"status": "Running",
14+
"message": "HRMS Lite Backend is running",
15+
"database_status": db_status,
16+
"port": 8000,
17+
"api_version": "v1",
918
"endpoints": {
1019
"employees": "/api/employees/",
1120
"attendance": "/api/attendance/",

frontend/.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Production API URL - Update this after backend deployment
2-
VITE_API_URL=https://hrms-lite-backend.onrender.com/api
2+
VITE_API_URL=https://hrms-lite-fnjz.onrender.com/api

0 commit comments

Comments
 (0)