diff --git a/index.js b/index.js index 48e787e..23bba5f 100644 --- a/index.js +++ b/index.js @@ -35,6 +35,7 @@ server.use("/service-worker.js", (req, res) => ); server.use(router); -server.listen(3000, () => { - console.log("JSON Server is running on port 3000"); -}); +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 6542e1b..b1ccb43 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "Source code for the Pluralsight course JavaScript Promises and Async Programming", "main": "index.js", "scripts": { - "dev": "nodemon ./index.js" + "dev": "nodemon ./index.js", + "secondary": "cross-env PORT=3001 nodemon ./index.js" }, "repository": { "type": "git", @@ -17,10 +18,11 @@ }, "homepage": "https://github.com/taylonr/async-programming-promises#readme", "dependencies": { + "cross-env": "^7.0.2", "express": "^4.17.1", "json-server": "^0.15.1" }, "devDependencies": { "nodemon": "^2.0.2" } -} +} \ No newline at end of file diff --git a/src/creating.mjs b/src/creating.mjs index dbf51e2..22c76fe 100644 --- a/src/creating.mjs +++ b/src/creating.mjs @@ -1,4 +1,4 @@ -import setText from './results.mjs'; +import setText, { appendText } from "./results.mjs"; export function timeout(){ } diff --git a/src/iterating.mjs b/src/iterating.mjs index dfe19b0..849f352 100644 --- a/src/iterating.mjs +++ b/src/iterating.mjs @@ -13,6 +13,4 @@ export function concurrent(){ } export function parallel(){ -} - - +} \ No newline at end of file