diff --git a/package.json b/package.json index 219f23b..8da7433 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "API code examples for JavaScript Everywhere by Adam Scott, published by O'Reilly Media", "main": "src/index.js", "scripts": { + "server": "nodemon index.js", "start": "nodemon src/index.js", "dev": "nodemon src/index.js", "final": "nodemon final/index.js", diff --git a/src/index.js b/src/index.js index f139e0a..8506f17 100644 --- a/src/index.js +++ b/src/index.js @@ -1,2 +1,8 @@ // index.js // This is the main entry point of our application +const express = require ('express'); +const app = express(); +const port = process.env.PORT || 4000; +app.get ('/', (req,res) => res.send ('Hello nice Server!!!')); +app.listen (port, () => +console.log (`Server running at http:// localhost: ${port}`)); \ No newline at end of file