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 DatabaseService = require('./services/DatabaseService');
const app = express(); const app = express();
const port = 3000; const port = 3003;
// Middleware // Middleware
app.use(cors( app.use(cors(
{ {
origin: 'http://localhost:3001', origin: 'http://localhost:3000',
credentials: true credentials: true
} }
)); // Autoriser les requêtes cross-origin )); // Autoriser les requêtes cross-origin

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

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

Loading…
Cancel
Save