From 965aa80fe00f7711ce4186d9c94aff76b8d7c236 Mon Sep 17 00:00:00 2001 From: aortigos Date: Thu, 7 May 2026 23:36:07 +0200 Subject: [PATCH] fixes --- backend/index.js | 6 ++++-- frontend/src/pages/Login.jsx | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/index.js b/backend/index.js index 34775af..4867368 100644 --- a/backend/index.js +++ b/backend/index.js @@ -1,13 +1,15 @@ import express from 'express' import dotenv from 'dotenv' +dotenv.config() + import cors from 'cors' const app = express() const port = 5000 app.use(express.json()) -app.use(cors({ origin: 'http://localhost:5173' })) -dotenv.config() +app.use(cors()) + import { prisma } from './prisma.js' diff --git a/frontend/src/pages/Login.jsx b/frontend/src/pages/Login.jsx index c92694f..c6d4eb1 100644 --- a/frontend/src/pages/Login.jsx +++ b/frontend/src/pages/Login.jsx @@ -14,7 +14,7 @@ function Login() { const handleSubmit = async (e) => { e.preventDefault() - const res = await fetch('https://localhost:5000/login', { + const res = await fetch('http://localhost:5000/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email, password }) @@ -35,7 +35,7 @@ function Login() { <>
-
+

Inicia sesion

@@ -58,7 +58,7 @@ function Login() { />
-
+