“Как создать сервер в узле JS” Ответ

Как создать сервер в узле JS

// code by VARSHITH REDDY SATTI
// to create a server in node.js you should.
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.write("write html code to display you test")
  res.end();
}).listen(8080);
// save this as httpServer.js
// run this by typing node httpServer.js in the command line
// to acess your server got to http://localhost:8080
Crown Of Thorns Starfish

Простой сервер Nodejs

// One Line ES6
require('http').createServer((req, res) => res.end(`You're in: ${req.url}`)).listen(8080, err => err ? console.log : console.log(`Listening on port 8080`))
Ashamed Ant

Ответы похожие на “Как создать сервер в узле JS”

Вопросы похожие на “Как создать сервер в узле JS”

Больше похожих ответов на “Как создать сервер в узле JS” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования