skip to Main Content

Javascript – Empty data getting posted in Mongodb database using Node JS html

How to slove this problem Please help me const express=require("express"); const app=express(); const bodyparser=require("body-parser"); const cors=require("cors"); const mongoose=require("mongoose"); const PORT=4000; app.use(cors()); app.use(express.urlencoded({extended:false})); app.use(express.json()); app.use(bodyparser.urlencoded({extended:true})); const URL='mongodb+srv://username:[email protected]/UserDB'; const userSchema=new mongoose.Schema({ name:{ type:String }, password:{ type:String } }); const UserModel= mongoose.model("userData",userSchema); app.get("/",(req,res)=>{…

VIEW QUESTION
Back To Top
Search