一:服务器基本搭建
var http = require('http');
-
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\n'); }).listen(8888); console.log('Server running at http://127.0.0.1:8888/');
二:路由
三:读写文件
四:读取图片路由改造
五:参数接收
六:正则表达式
七:一步流程控制
八:数据库的连接
九:时间机制
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\n'); }).listen(8888); console.log('Server running at http://127.0.0.1:8888/');
本文介绍了使用Node.js快速搭建一个简易服务器的过程,并覆盖了从基本服务器启动到处理复杂请求的各项功能,包括路由设置、文件读写、图片路由改造、参数接收等内容。
819

被折叠的 条评论
为什么被折叠?



