start node.js server
## Make sure you run this command in the app directory.
node .
start node.js server
## Make sure you run this command in the app directory.
node .
how to start a node server
// app.js
const http = require('http');
const fs = require('fs')
// Create an instance of the http server to handle HTTP requests
let app = http.createServer((req, res) => {
// Set a response type of plain text for the response
res.writeHead(200, {'Content-Type': 'text/html'});
fs.createReadStream('index.html').pipe(res)
});
// Start the server on port 3000
app.listen(3000, '127.0.0.1');
console.log('Node server running on port 3000');
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us