server.js

const http = require('http');

http.createServer(function(req,res){
    console.log('req come', req.url);
    res.end('123');
}).listen(8888);

console.log('server listening on 8888');
console.log('http://localhost:8888/')

用node创建一个最简单的服务