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
letexpress=require('express');letcors=require('cors');// Use cors module for enable Cross-origin resource sharingletapp=express();app.use(cors());// for all routesletport=process.env.PORT||3000;app.get('/',function(req,res){/*** 1st Way ****/letinfo={'string_value': 'Morol','number_value': 171}res.json(info);/*** 2nd Way ****/res.send(JSON.stringify({string_value: 'Morol',number_value: 171}));/*** 3rd Way ****/res.status(200).json(info);});app.listen(port,function(){console.log('Node.js listening on port '+port)});