Question: erify that Node.js is working correctly. Run the command prompt Type node v Type npm v Capture a Snip of the results of these two

erify that Node.js is working correctly.

Run the command prompt

Type node v

Type npm v

Capture a Snip of the results of these two commands

Copy and Save the Snip in a Word document (.docx)

Use the filename Chapter_1_Assignment_Snips_Lastname.docx (ex. Chapter_1_Assignment_Snips_Arrington.docx)

While still in command prompt, type the following code:

Type node and press Enter

Type console.log(Hello node); then press Enter

Capture a Snip of the results

Copy and Save the Snip to the same file Chapter_1_Assignment_Snips_Lastname.docx (ex. Chapter_1_Assignment_Snips_Arrington.docx)'

Open notepad++ or other text editor and copy the code below and paste into the editor:

const http = require('http');

const hostname = '127.0.0.1';

const port = 3000;

const server = http.createServer((req, res) => {

res.statusCode = 200;

res.setHeader('Content-Type', 'text/plain');

res.end('Hello World ');

});

server.listen(port, hostname, () => {

console.log(`Server running at http://${hostname}:${port}/`);

});

Save the file as app.js.

Find the folder with the file and press the shift key while right clicking on the folder.

Click the command Open command window here

Type at the command prompt node app.js and press Enter

Capture a Snip of the results, copy the Snip, save to same file as other Snips

Open a browser and type in the address shown above 127.0.0.1:3000

Capture a Snip of you browser screen and save to the same file as the other Snips

These exercises indicate that your version of Node.js is working correctly.

i need these snips thank you in advance

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!