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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started