From b0017ce6aa67333c81c0bd3a8a3e4947300328fa Mon Sep 17 00:00:00 2001 From: aminamos <26092352+aminamos@users.noreply.github.com> Date: Tue, 7 Apr 2020 08:53:21 -0700 Subject: [PATCH] allow for port 3001 and 3000 --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 0aea3b5..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"); -}); \ No newline at end of file +const port = process.env.PORT || 3000 +server.listen(port, () => { + console.log(`JSON Server is running on port ${port}`); +}); \ No newline at end of file