modification server api

pull/81/head
Baptiste MARCEL 1 year ago
parent 929962b2b6
commit 9f43096b19

@ -7,12 +7,12 @@ const authRoutes = require('./routes/authRoutes');
const DatabaseService = require('./services/DatabaseService');
const app = express();
const port = 3000;
const port = 3003;
// Middleware
app.use(cors(
{
origin: 'http://localhost:3001',
origin: 'http://localhost:3000',
credentials: true
}
)); // Autoriser les requêtes cross-origin

@ -12,7 +12,7 @@ class AuthService{
static async signUp(data: any) {
try {
const response = await fetch('http://localhost:3000/auth/signup', {
const response = await fetch('http://localhost:3003/auth/signup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -36,7 +36,7 @@ class AuthService{
static async signIn(data: any) {
try {
const response = await fetch('http://localhost:3000/auth/signin', {
const response = await fetch('http://localhost:3003/auth/signin', {
method: 'POST',
headers: {
'Content-Type': 'application/json',

@ -1,7 +1,7 @@
class SessionService {
static async getSession() {
try {
const response = await fetch('http://localhost:3000/session', {
const response = await fetch('http://localhost:3003/session', {
method: 'GET',
headers: {
'Content-Type': 'application/json',

Loading…
Cancel
Save