Use npm to install the required packages.
npm i
MySQL is needed locally. For installation details view the MySQL page. After installation you may face this issue
Create a .env file in the root of the project it should contain the following
SQL_USERNAME=username
SQL_PASSWORD=password
SQL_HOST=host
SQL_PORT=port
Run server using
node index.js
To change port
const express = require('express')
const app = express();
// Port
const port = 3000
app.listen(port, () => {
console.log("Server running on port " + port);
})
app.get("", (req, res) => {
res.send("<p>Server is up and running</p>")
})