From 7829a84bac0aeb02695d4841664f1f24126e4b1e Mon Sep 17 00:00:00 2001 From: aminamos <26092352+aminamos@users.noreply.github.com> Date: Tue, 7 Apr 2020 08:23:39 -0700 Subject: [PATCH] project setup additions --- index.js | 11 ++++++++--- package-lock.json | 46 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 48e787e..2720996 100644 --- a/index.js +++ b/index.js @@ -35,6 +35,11 @@ server.use("/service-worker.js", (req, res) => ); server.use(router); -server.listen(3000, () => { - console.log("JSON Server is running on port 3000"); -}); +// server.listen(3000, () => { +// console.log("JSON Server is running on port 3000"); +// }); +// allow for port 3001 +const port = process.env.PORT || 3000 +server.listen(port, () => { + console.log(`JSON Server is running on port ${port}`); +}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0897960..00ba006 100644 --- a/package-lock.json +++ b/package-lock.json @@ -410,6 +410,52 @@ "capture-stack-trace": "^1.0.0" } }, + "cross-env": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz", + "integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==", + "requires": { + "cross-spawn": "^7.0.1" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", + "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", diff --git a/package.json b/package.json index 6e2f7fc..5a63f32 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ }, "homepage": "https://github.com/taylonr/async-programming-promises#readme", "dependencies": { + "cross-env": "^7.0.2", "express": "^4.17.1", "json-server": "^0.15.1" },