Reputation: 1
I've worked with ReactJS before but this is my first time messing around with NodeJS This is the ReactJS code where I'm trying to send the Video File to the server
This is the NodeJS file I'm simply trying to print something to the console but nothing works
This is definitely a dumb question I know, it's just I don't know what I'm doing wrong, it's my first time messing around with Backend stuff.
Upvotes: 0
Views: 27
Reputation: 65
Have you added the CORS module to your backend so it accepts request from a different URL?
Install cors with 'npm install cors' then add the following to your backend server.js (or index.js or whatever file is creating the routes):
import cors from 'cors';
import express from 'express';
const app = express()
app.use(cors)
The app.use has to come before your routes
Upvotes: 2