server connects to localhost

This commit is contained in:
2022-04-18 14:06:22 -05:00
parent 7c39cbfabc
commit 767ce4953c
4 changed files with 35 additions and 0 deletions

1
.env Normal file
View File

@@ -0,0 +1 @@
PORT=8088

14
package-lock.json generated
View File

@@ -11,6 +11,7 @@
"dependencies": {
"body-parser": "^1.20.0",
"cors": "^2.8.5",
"dotenv": "^16.0.0",
"express": "^4.17.3"
}
},
@@ -143,6 +144,14 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/dotenv": {
"version": "16.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz",
"integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==",
"engines": {
"node": ">=12"
}
},
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@@ -845,6 +854,11 @@
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
"integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="
},
"dotenv": {
"version": "16.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz",
"integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q=="
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",

View File

@@ -12,6 +12,7 @@
"dependencies": {
"body-parser": "^1.20.0",
"cors": "^2.8.5",
"dotenv": "^16.0.0",
"express": "^4.17.3"
}
}

View File

@@ -0,0 +1,19 @@
const express = require('express');
const app = express();
require('dotenv').config({ path: './config.env' });
const PORT = process.env.PORT || 8088;
const cors = require('cors');
app.use(cors());
app.use(express.json());
app.use('/', (req, res) => {
res.send('Testing the server');
})
app.listen(PORT, () => {
console.log(`Listening on port ${PORT}`);
});