You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 4, 2023. It is now read-only.
require("dotenv").config();constexpress=require("express");constapp=express();constPort=process.env.PORT||5000;app.listen(Port,()=>console.log(`Server started at port no ${Port}`));
Connection with MongoDB
// MongoDB Atlasconstmongoose=require("mongoose");app.use(express.json());// Connect to MongoDBmongoose.connect(process.env.DB_URL,{useNewUrlParser: true});constdb=mongoose.connection;db.once("open",()=>console.log("Database Connected!"));db.on("error",(error)=>console.error(error));
About
Most basic level CRUD API based on Node, Express and MongoDB