Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
.DS_Store
node_modules
Binary file modified chapter2/第二章:技术预研篇.pdf
Binary file not shown.
25 changes: 25 additions & 0 deletions chapter3/1.download/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const koa = require('koa');
const fs = require('fs');
const mount = require('koa-mount');
const static = require('koa-static');

const app = new koa();

// 使用static中间件提供静态文件服务
// 以source/static目录为基准目录,所有访问该服务器并且路径是/static的请求都会在这个目录下找到静态文件
// 并返回回去
app.use(
mount('/static', static(__dirname + '/source/static/'))
);

// 根目录直接读出静态文件页面返回。
// 其实这个用static中间件也是能实现的。
app.use(
mount('/', async (ctx) => {
ctx.body = fs.readFileSync(__dirname + '/source/index.htm', 'utf-8')
})
);


// app.listen(4000);
module.exports = app;
2,203 changes: 2,203 additions & 0 deletions chapter3/1.download/source/index.htm

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions chapter3/1.download/source/static/9.88a55aada0b5e3e79968.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions chapter3/1.download/source/static/aliplayer-min.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions chapter3/1.download/source/static/aliplayer-min.js

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions chapter3/1.download/source/static/analytics.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Loading