Skip to content

Commit 97a186a

Browse files
authored
Update introduction-to-nodejs.md (#6482)
ReferenceError: http is not defined fixed in docs
1 parent 2eced3c commit 97a186a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pages/en/about/index.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const { createServer } = require('node:http');
1616
const hostname = '127.0.0.1';
1717
const port = 3000;
1818

19-
const server = http.createServer((req, res) => {
19+
const server = createServer((req, res) => {
2020
res.statusCode = 200;
2121
res.setHeader('Content-Type', 'text/plain');
2222
res.end('Hello World');
@@ -33,7 +33,7 @@ import { createServer } from 'node:http';
3333
const hostname = '127.0.0.1';
3434
const port = 3000;
3535

36-
const server = http.createServer((req, res) => {
36+
const server = createServer((req, res) => {
3737
res.statusCode = 200;
3838
res.setHeader('Content-Type', 'text/plain');
3939
res.end('Hello World');

pages/en/learn/getting-started/introduction-to-nodejs.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const { createServer } = require('node:http');
3030
const hostname = '127.0.0.1';
3131
const port = 3000;
3232

33-
const server = http.createServer((req, res) => {
33+
const server = createServer((req, res) => {
3434
res.statusCode = 200;
3535
res.setHeader('Content-Type', 'text/plain');
3636
res.end('Hello World');
@@ -47,7 +47,7 @@ import { createServer } from 'node:http';
4747
const hostname = '127.0.0.1';
4848
const port = 3000;
4949

50-
const server = http.createServer((req, res) => {
50+
const server = createServer((req, res) => {
5151
res.statusCode = 200;
5252
res.setHeader('Content-Type', 'text/plain');
5353
res.end('Hello World');

0 commit comments

Comments
 (0)