Setting Up A Node + Express Backend

npm init -y
npm i express cors
npm i -g nodemon
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js",
"dev": "nodemon index.js"
},
const express = require('express');
const app = express();
const cors = require('cors');
const { response } = require('express');
const PORT = 4000;
app.use(cors());app.listen(PORT, function() {
console.log("Server is running on Port: " + PORT);
})

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store