Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"configurations": [
{
"type": "chrome",
"name": "http://127.0.0.1:8000/src/index.html",
"request": "launch",
"url": "http://127.0.0.1:8000/src/index.html"
},
{
"type": "chrome",
"name": "http://127.0.0.1:8000/index.html",
"request": "launch",
"url": "http://127.0.0.1:8000/index.html"
}
]
}
"configurations": [
{
"type": "chrome",
"name": "http://127.0.0.1:8000/src/index.html",
"request": "launch",
"url": "http://127.0.0.1:8000/src/index.html"
},
{
"type": "chrome",
"name": "http://127.0.0.1:8000/index.html",
"request": "launch",
"url": "http://127.0.0.1:8000/index.html"
}
]
}
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"livePreview.defaultPreviewPath": "/index.html",
"typescript.suggestionActions.enabled": false,
"javascript.suggestionActions.enabled": false,
}
"livePreview.defaultPreviewPath": "/index.html",
"typescript.suggestionActions.enabled": false,
"javascript.suggestionActions.enabled": false
}
23 changes: 10 additions & 13 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"target": "ES2020",
"jsx": "react",
"strictNullChecks": true,
"strictFunctionTypes": true
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"target": "ES2020",
"jsx": "react",
"strictNullChecks": true,
"strictFunctionTypes": true
},
"exclude": ["node_modules", "**/node_modules/*"]
}
70 changes: 34 additions & 36 deletions src/Js/index.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,48 @@
const express = require("express");
const dotenv = require("dotenv").config();
const port = process.env.PORT || 5000;
const express = require('express')
const dotenv = require('dotenv').config()
const port = process.env.PORT || 5000
// const port = "https://localhost:3000"

const app = express();
const mongoose = require("mongoose");
const app = express()
const mongoose = require('mongoose')

mongoose.connect(
"mongodb+srv://riju:<password>@cluster1.doybfcn.mongodb.net/test", {
useNewUrlParser: true,
useUnifiedTopology: true,
}, (err) => {
'mongodb+srv://riju:<password>@cluster1.doybfcn.mongodb.net/test',
{
useNewUrlParser: true,
useUnifiedTopology: true
},
(err) => {
if (err) {
console.log("Error in connecting to database");
console.log('Error in connecting to database')
} else {
console.log("Connected to database");
console.log('Connected to database')
}
}
);
)


app.listen(port, () => console.log(`Server started on port ${port}`));
app.listen(port, () => console.log(`Server started on port ${port}`))

// Path: src\Js\index.js
var person = [
{
name: "John",
age: 31,
},
{
name: "Riju",
age: 30,
},
{
name: "Raja",
age: 29,
}

];
person = JSON.stringify(person);
person = JSON.parse(person);

console.log(person.age);
let person = [
{
name: 'John',
age: 31
},
{
name: 'Riju',
age: 30
},
{
name: 'Raja',
age: 29
}
]
person = JSON.stringify(person)
person = JSON.parse(person)

async function getdata() {
let result = await client.connect()

console.log(person.age)

async function getdata () {
const result = await client.connect()
}