Files
myapp/app.js
T
2026-09-23 16:49:12 +05:30

27 lines
560 B
JavaScript

const http = require("http");
const PORT = 3002;
const server = http.createServer((req, res) => {
res.writeHead(200, {
"Content-Type": "text/html"
});
res.end(`
<!DOCTYPE html>
<html>
<head>
<title>My Node App</title>
</head>
<body>
<h1>Hello from Node.js!</h1>
<p>Welcome, This application is running on Windows 10.</p>
</body>
</html>
`);
});
server.listen(PORT, () => {
console.log(`Server running at http://localhost:${PORT}`);
});