Node.js
安装:
下载:
https://nodejs.org/en/
更改淘宝镜像,安装cnpm命令
npm install -g cnpm --registry=https://registry.npm.taobao.org
文档:
https://nodejs.org/zh-cn/docs/
可用包查询:
https://npm.taobao.org/
//1,加载http包
var http = require("http");
var app = http.createServer(function (req,res) {
//设置文档的字符集,解决中乱码问题
res.writeHead(200,{"Content-Type":"text/html;charset=utf-8"});
//将内容写入到浏览器
res.write("小宝的媳妇最多");
res.write("<h1>小宝的鱼塘大</h1>");
//输出结束
res.end('aaa');
});
//设置端口
app.listen("8800");
console.log('http://localhost:8800');
gitbook安装:
npm install gitbook-cli -g
选择你的文档目录,并在文档内执行初始化:
gitbook init
创建编译文档文件:
gitbook build
通过命令,运行打开电子书的web界面
gitbook serve
这时会显示出你的电子书浏览的本地地址,默认:
http://localhost:4000 在浏览器打开即可看到你的电子书界面