This commit is contained in:
bahramsa70 2024-06-11 23:26:53 +03:30
parent d471614837
commit c845f1f6c5
5 changed files with 31 additions and 15 deletions

1
.env Normal file
View File

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

View File

@ -3,16 +3,16 @@ import pluginJs from "@eslint/js";
export default [
{ files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } },
{ languageOptions: { globals: globals.browser } },
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
{
rules: {
"prefer-const": "off",
"quotes": ["warn", "double", { "allowTemplateLiterals": true }],
"no-unused-vars": "warn",
"no-multi-spaces": "warn",
"no-multiple-empty-lines": ["warn", { "max": 1 }],
"no-case-declarations": "off"
}
}
"no-case-declarations": "off",
"no-multiple-empty-lines": ["warn", { max: 1 }],
quotes: ["warn", "double", { allowTemplateLiterals: true }],
},
},
];

12
package-lock.json generated
View File

@ -9,6 +9,7 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"dotenv": "^16.4.5",
"express": "^4.19.2"
},
"devDependencies": {
@ -601,6 +602,17 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/dotenv": {
"version": "16.4.5",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz",
"integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://dotenvx.com"
}
},
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",

View File

@ -10,6 +10,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"dotenv": "^16.4.5",
"express": "^4.19.2"
},
"devDependencies": {

View File

@ -1,9 +1,11 @@
require("dotenv").config();
const express = require("express");
const app = express();
const PORT = process.env.PORT
app.use((req, res, next) => {
res.send("Hello");
});
app.listen(3000);
app.listen(PORT);