- Create a new file named debugging.js
- Initialize a new ExpressJS application:
const express = require('express')
const app = express()
- Add a route method to handle GET requests for any path:
app.get('*', (request, response, next) => {
response.send('Hello there!')
})
- Listen on port 1337 for new connections:
app.listen(
1337,
() => console.log('Web Server running on port 1337'),
)
- Save the file
- Open a terminal and run:
- On Windows:
set DEBUG=express:* node debugging.js
- On Linux or MacOS:
DEBUG=express:* node debugging.js
- In your web browser, navigate to:
http://localhost:1337/
- Observe your terminal's output for logs
..................Content has been hidden....................
You can't read the all page of ebook, please click
here login for view all page.