Skip to content

Commit cb70781

Browse files
authored
feat: init vuepress (#1)
1 parent 6c80376 commit cb70781

32 files changed

+5996
-0
lines changed

docs/.vuepress/config.js

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
title: 'Egg',
5+
host: '0.0.0.0',
6+
description: 'Egg 文档',
7+
evergreen: true,
8+
locales: {
9+
'/': {
10+
lang: 'en-US',
11+
title: 'Egg',
12+
description: 'Born to build better enterprise frameworks and apps with Node.js & Koa',
13+
},
14+
'/zh/': {
15+
lang: 'zh-CN',
16+
title: 'Egg',
17+
description: '为企业级框架和应用而生',
18+
},
19+
},
20+
dest: path.join(__dirname, '../../dist'),
21+
markdown: {
22+
lineNumbers: true,
23+
},
24+
devServer: {
25+
overlay: {
26+
// warnings: true,
27+
errors: true,
28+
},
29+
},
30+
themeConfig: {
31+
locales: {
32+
'/': {
33+
selectText: 'Languages',
34+
label: 'English',
35+
editLinkText: 'Edit this page on GitHub',
36+
serviceWorker: {
37+
updatePopup: {
38+
message: 'New content is available.',
39+
buttonText: 'Refresh',
40+
},
41+
},
42+
nav: [
43+
{ text: 'Home', link: '/' },
44+
{ text: 'QuickStart', link: '/quickstart/' },
45+
{ text: 'Guide', link: '/guide/' },
46+
],
47+
sidebar: {
48+
'/quickstart/': [
49+
['./', 'QuickStart'],
50+
'egg'
51+
],
52+
53+
'/guide/': [
54+
['./', 'Description'],
55+
'directory',
56+
'middleware',
57+
'controller',
58+
'router',
59+
'service',
60+
'application',
61+
'context',
62+
'config',
63+
'logger',
64+
'cookie',
65+
'session',
66+
'helper',
67+
'httpclient',
68+
'error_handler',
69+
'lifecycle',
70+
'plugin',
71+
'upload',
72+
'i18n',
73+
],
74+
},
75+
},
76+
'/zh/': {
77+
selectText: '选择语言',
78+
label: '简体中文',
79+
editLinkText: '在 GitHub 上编辑此页',
80+
serviceWorker: {
81+
updatePopup: {
82+
message: '发现新内容可用.',
83+
buttonText: '刷新',
84+
},
85+
},
86+
nav: [
87+
{ text: '首页', link: '/zh/' },
88+
{ text: '快速开始', link: '/zh/quickstart/' },
89+
{ text: '教程', link: '/zh/guide/' },
90+
],
91+
sidebar: {
92+
'/zh/quickstart/': [
93+
['./', '快速开始'],
94+
'egg'
95+
],
96+
97+
'/zh/guide/': [
98+
['./', '概述'],
99+
'directory',
100+
'middleware',
101+
'controller',
102+
'router',
103+
'service',
104+
'application',
105+
'context',
106+
'config',
107+
'logger',
108+
'cookie',
109+
'session',
110+
'helper',
111+
'httpclient',
112+
'error_handler',
113+
'lifecycle',
114+
'plugin',
115+
'upload',
116+
'i18n',
117+
],
118+
},
119+
},
120+
},
121+
},
122+
};

docs/.vuepress/public/icon.svg

Lines changed: 94 additions & 0 deletions
Loading

docs/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
home: true
3+
heroImage: /icon.svg
4+
heroText: EggJs
5+
tagline: Born to build better enterprise frameworks and apps with Node.js & Koa
6+
actionText: QuickStart →
7+
actionLink: /zh/guide/
8+
features:
9+
- title: Egg
10+
details: Egg Detail
11+
footer: MIT Licensed
12+
---

docs/guide/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Guide
3+
navTitle: Egg Guide
4+
toc: false
5+
---
6+
7+
guide

docs/quickstart/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: QuickStart
3+
---
4+
5+
QuickStart

docs/zh/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
home: true
3+
heroImage: /icon.svg
4+
heroText: EggJs
5+
tagline: 为企业级框架和应用而生
6+
actionText: 快速上手 →
7+
actionLink: /zh/guide/
8+
features:
9+
- title: Egg
10+
details: Egg Detail
11+
footer: MIT Licensed
12+
---

docs/zh/guide/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: 概述
3+
navTitle: Egg 指南
4+
toc: false
5+
---
6+
7+
在本篇中,我们会对每一个术语概念,逐一进行详细的讲解。
8+
9+
包括它的适用场景、如何使用、常用的方法和属性、如何扩展、如何测试等等。
10+
11+
## Web 模型
12+
13+
框架奉行『约定优于配置』,因此我们首先需要了解下 [目录规范] 的约定。
14+
15+
其次,对于一个 Web 应用来说,一般会采用 `MVC` 模型。
16+
17+
对应的概念有:
18+
19+
- [Middleware]`Koa` 的洋葱模型,类似 `Java``Filter`
20+
- [Controller]:控制器,处理和校验用户请求,然后调用业务逻辑层,最终发送响应给用户。
21+
- [Router]:路由,对用户请求进行分派。
22+
- [Service]:业务逻辑层。
23+
- [Application]:全局应用对象,通过它可以获取 [配置文件] 等信息。
24+
- [Context]:用户请求的上下文,用于获取请求信息和设置响应信息。
25+
- 此外,还有 [Cookie][Session][Helper] 等等。
26+
27+
## 功能模块
28+
29+
除此之外,还提供了很多研发过程中需要的 `Utils`
30+
31+
- [使用插件]:生态共建的基础,一分钟即可通过插件接入各自基础中间件服务。
32+
- [生命周期]:方便开发者做一些初始化工作。
33+
- [日志]:对应用的运行状态监控、问题排查等都有非常重要的意义。
34+
- [异常处理]:程序健壮性的保障。
35+
- [安全]:安全无小事。
36+
- 还有 [文件上传][国际化] 等等。
37+
38+
[目录规范]: ./directory.md
39+
[Controller]: ./controller.md
40+
[Service]: ./service.md
41+
[Router]: ./router.md
42+
[Cookie]: ./cookie.md
43+
[Session]: ./session.md
44+
[Application]: ./application.md
45+
[Context]: ./context.md
46+
[Middleware]: ./middleware.md
47+
[使用插件]: ./plugin.md
48+
[生命周期]: ./lifecycle.md
49+
[配置文件]: ./config.md
50+
[日志]: ./logger.md
51+
[异常处理]: ./error_handler.md
52+
[Helper]: ./helper.md
53+
[安全]: ../ecosystem/security/
54+
[文件上传]: ./upload.md
55+
[国际化]: ./i18n.md

0 commit comments

Comments
 (0)