1 前端环境搭建
1 模块化编程
1 2 3 4 5 6 7 8 9
| //被调用的模块 ---demo3_1 export.add=function(a,b){ return a+b;
## }
//调用模块 var demo=require(‘./demo3_1’) demo.add(200,300);
|
2 创建web服务器
http://nodejs.cn/api/http.html


1 2 3 4 5 6 7 8 9 10 11
| 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/');
|
3 服务端渲染
Author:
John Doe
Permalink:
http://yoursite.com/2019/06/25/项目实战/十次方项目/
License:
Copyright (c) 2019 CC-BY-NC-4.0 LICENSE
Slogan:
Do you believe in DESTINY?