skip to Main Content

Javascript – ValidationError: Collection2 validation failed: name: Path `name` is required., email: Path `email` is required., message: Path `message` is required

I have to receive message from the visitor on the website const mongoose = require("mongoose"); mongoose.connect("mongodb+srv://hello:[email protected]/") .then(() => { console.log("mongodb connected"); }) .catch(() => { console.log("failed to connect"); }); const LoginSchema = new mongoose.Schema({ name: { type: String, required: true…

VIEW QUESTION

Javascript – Socket.io connection error net::ERR_CONNECTION_REFUSED when accessing from different devices

I've encountered an error with other people's computers, they can't access my little test chatting application, and incounter this error when attempting to connect: localhost:3000/socket.io/?EIO=4&transport=polling&t=Oi2Ko0C:1 Failed to load resource: net::ERR_CONNECTION_REFUSED localhost:3000/socket.io/?EIO=4&transport=polling&t=Oi2KorJ:1 My socket.io version is: 4.7.2 and I'm port fowarding…

VIEW QUESTION

Reactjs – Frontend React unable to call API due to blocked CORS

Profile.jsx const res = await fetch(`http://localhost:5000/api/user/update/${currentUser._id}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(formData) }) Error Access to fetch at 'http://localhost:5000/api/user/update/651cce95aa88ef0726740018' from origin 'http://localhost:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control…

VIEW QUESTION
Back To Top
Search