createServer

const http = require('http');
 
/**
 * calback функция - обработчик запросов ,
 * request - запрос
 * response - ответ
 */
const server = http.createServer(function(request, response){
    console.log(request.url);//вернет в консоль url - http://127.0.0.1:3000/adda
    //в консоле - /adda
 
});
 
/**
 * Установить прослушку на 3000 порт
 */
server.listen(3000, function(){
 
    console.log('server start on port 3000');
});