-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
50 lines (36 loc) · 1.2 KB
/
index.js
File metadata and controls
50 lines (36 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import dotenv from "dotenv";
dotenv.config();
import express from "express";
import cookieParser from "cookie-parser";
import app from "./app.js";
app.use(express.json({ limit: "16kb" })); // It is used to parse the JSON data.
app.use(express.urlencoded({ extended: true, limit: "16kb" })); // It is ude
app.use(express.static("public"));
app.use(cookieParser());
// Main jargon for today is understanding how json data coming is being understood by My backend and
// Potentially then rendered over the screen as well.
// res.send() res.json()
// (async ()=> {
// try{
// await mongoose.connect(`${process.env.MONGODB_URI}`);
// app.on("error",(err)=>{
// console.log("Error",err);
// throw err;
// })
// app.listen(port,()=>{
// console.log(`App is listening to ${port}`);
// })
// }catch(e){
// console.error(e);
// }
// }
// )()
// const userDb=[{id:1,name:"Akarsh",todo:"Go to gym"},{id:2,name:"Swapnil",todo:"Go to Banglore"}];
// app.get("/",(req,res)=>{
// res.send("Server is listening ");
// });
// app.post("/signIn",(req,res)=>{
// })
// app.get("/api/users",(req,res)=>{
// res.send(userDb);
// })