Skip to content

Commit

Permalink
optimize directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Dec 26, 2018
1 parent c68251e commit 38a90e2
Show file tree
Hide file tree
Showing 475 changed files with 52 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package-lock.json
.idea
.DS_Store
docs/.vuepress/dist
config/app.json
config/config.js
lib/config/app.json
lib/config/config.js
yarn-error.log
tmp
*.swp
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: node index.js
web: node lib/index.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇

### 提交新的 RSS 内容

1.[/router.js](https://github.com/DIYgod/RSSHub/blob/master/router.js) 里添加路由
1.[/lib/router.js](https://github.com/DIYgod/RSSHub/blob/master/lib/router.js) 里添加路由

2.[/routes/](https://github.com/DIYgod/RSSHub/tree/master/routes) 中的路由对应路径添加获取 RSS 内容的脚本

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ services:
CACHE_TYPE: redis
REDIS_URL: 'redis://db.redis:6379/'
volumes:
- ./config/app.json:/app/app.json
- ./config/config.js:/app/config.js
- ./lib/config/app.json:/app/lib/app.json
- ./lib/config/config.js:/app/lib/config.js
depends_on:
- db.redis

Expand Down
2 changes: 1 addition & 1 deletion docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ RSSHub provides the following APIs:
### List of Public Routes

::: tip Tip
This API **will not** return any routes under `protected_router.js`.
This API **will not** return any routes under `lib/protected_router.js`.
:::

Eg: <https://rsshub.app/api/routes/github>
Expand Down
6 changes: 3 additions & 3 deletions docs/en/install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ $ git pull

### Configuration

`RSSHub` reads its configurations from `config.js` or system environment variables.
`RSSHub` reads its configurations from `lib/config.js` or system environment variables.

**How to set system environment variables**

Expand Down Expand Up @@ -150,7 +150,7 @@ $ docker volume create redis-data

2. Change `environment` section in [docker-compose.yml](https://github.com/DIYgod/RSSHub/blob/master/docker-compose.yml) to configure the corresponding option

- `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1` skips puppeteer Chromium installation. Default to 1, requires `puppeteerWSEndpoint` in `config.js` to be set with a remote Chrome Websocket address, otherwise relevant routes will not work.
- `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1` skips puppeteer Chromium installation. Default to 1, requires `puppeteerWSEndpoint` in `lib/config.js` to be set with a remote Chrome Websocket address, otherwise relevant routes will not work.
- `USE_CHINA_NPM_REGISTRY=1` avoids GFW npm registry interference in mainland China. Default to 0.

3. Deploy
Expand Down Expand Up @@ -250,7 +250,7 @@ You can access your `Google App Engine URL` to check the deployment status

### Application Settings

`RSSHub` reads its configurations from `config.js` or environment variables.
`RSSHub` reads its configurations from `lib/config.js` or environment variables.

::: tip

Expand Down
4 changes: 2 additions & 2 deletions docs/en/joinus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ We welcome all pull requests. Suggestions and feedback are also welcomed [here](

## Submit new RSS source

1. Add a new route in [/router.js](https://github.com/DIYgod/RSSHub/blob/master/router.js)
1. Add a new route in [/lib/router.js](https://github.com/DIYgod/RSSHub/blob/master/lib/router.js)

1. Add the script to the corresponding directory [/routes/](https://github.com/DIYgod/RSSHub/tree/master/routes)

Expand Down Expand Up @@ -87,7 +87,7 @@ Some websites provides no API and pages require rendering too, use [puppeteer](h
### Enable caching
All routes has a default cache expiry time set in `config.js`, it should be increased when the data source is not subject to frequent updates.
All routes has a default cache expiry time set in `lib/config.js`, it should be increased when the data source is not subject to frequent updates.
Add to cache:
Expand Down
6 changes: 3 additions & 3 deletions docs/install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $ git pull

### 添加配置

可以通过修改 `config.js` 或者设置环境变量来配置 RSSHub.
可以通过修改 `lib/config.js` 或者设置环境变量来配置 RSSHub.

**如何设置环境变量**

Expand Down Expand Up @@ -154,7 +154,7 @@ $ docker volume create redis-data

2. 修改 [docker-compose.yml](https://github.com/DIYgod/RSSHub/blob/master/docker-compose.yml) 中的 `environment` 进行配置

- `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1` 用以跳过 puppeteer Chromium 的安装. 默认为 1, 需要在 `config.js` 中的 `puppeteerWSEndpoint`中设置相应的远程 Chrome Websocket 地址, 以启用相应路由.
- `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1` 用以跳过 puppeteer Chromium 的安装. 默认为 1, 需要在 `lib/config.js` 中的 `puppeteerWSEndpoint`中设置相应的远程 Chrome Websocket 地址, 以启用相应路由.
- `USE_CHINA_NPM_REGISTRY=1` 防止 npm 受到来自 GFW 的干扰. 默认为 0.

3. 部署
Expand Down Expand Up @@ -256,7 +256,7 @@ gcloud app deploy

### 应用配置

可以通过修改 `config.js` 或者设置环境变量来配置 RSSHub.
可以通过修改 `lib/config.js` 或者设置环境变量来配置 RSSHub.

::: tip 提示

Expand Down
64 changes: 32 additions & 32 deletions docs/joinus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ sidebar: auto

#### 使用缓存

所有路由都有一个缓存,全局缓存时间在 `config.js` 里设定,但某些接口返回的内容更新频率较低,这时应该给这些数据设置一个更长的缓存时间。
所有路由都有一个缓存,全局缓存时间在 `lib/config.js` 里设定,但某些接口返回的内容更新频率较低,这时应该给这些数据设置一个更长的缓存时间。

- 添加缓存:

Expand Down Expand Up @@ -361,48 +361,48 @@ ctx.state.data = {

### 步骤 2: 添加脚本路由

在 [/router.js](https://github.com/DIYgod/RSSHub/blob/master/router.js) 里添加路由:
在 [/lib/router.js](https://github.com/DIYgod/RSSHub/blob/master/lib/router.js) 里添加路由:

#### 举例

1. [bilibili/bangumi](https://github.com/DIYgod/RSSHub/blob/master/routes/bilibili/bangumi.js)

| 类型 | 代码 |
| ---------------------- | ---------------------------------------------------------------------------------- |
| 路由 | `/bilibili/bangumi/:seasonid` |
| 数据来源 | bilibili |
| 路由名称 | bangumi |
| 参数 1 | :seasonid 必选 |
| 参数 2 | 无 |
| 参数 3 | 无 |
| 脚本路径 | `./routes/bilibili/bangumi` |
| router.js 中的完整代码 | `router.get('/bilibili/bangumi/:seasonid', require('./routes/bilibili/bangumi'));` |
| 类型 | 代码 |
| -------------------------- | ---------------------------------------------------------------------------------- |
| 路由 | `/bilibili/bangumi/:seasonid` |
| 数据来源 | bilibili |
| 路由名称 | bangumi |
| 参数 1 | :seasonid 必选 |
| 参数 2 ||
| 参数 3 ||
| 脚本路径 | `./routes/bilibili/bangumi` |
| lib/router.js 中的完整代码 | `router.get('/bilibili/bangumi/:seasonid', require('./routes/bilibili/bangumi'));` |

1. [github/issue](https://github.com/DIYgod/RSSHub/blob/master/routes/github/issue.js)

| 类型 | 代码 |
| ---------------------- | ---------------------------------------------------------------------------- |
| 路由 | `/github/issue/:user/:repo` |
| 数据来源 | github |
| 路由名称 | issue |
| 参数 1 | :user 必选 |
| 参数 2 | :repo 必选 |
| 参数 3 | 无 |
| 脚本路径 | `./routes/github/issue` |
| router.js 中的完整代码 | `router.get('/github/issue/:user/:repo', require('./routes/github/issue'));` |
| 类型 | 代码 |
| -------------------------- | ---------------------------------------------------------------------------- |
| 路由 | `/github/issue/:user/:repo` |
| 数据来源 | github |
| 路由名称 | issue |
| 参数 1 | :user 必选 |
| 参数 2 | :repo 必选 |
| 参数 3 ||
| 脚本路径 | `./routes/github/issue` |
| lib/router.js 中的完整代码 | `router.get('/github/issue/:user/:repo', require('./routes/github/issue'));` |

1. [embassy](https://github.com/DIYgod/RSSHub/blob/master/routes/embassy/index.js)

| 类型 | 代码 |
| ---------------------- | ---------------------------------------------------------------------------- |
| 路由 | `/embassy/:country/:city?` |
| 数据来源 | embassy |
| 路由名称 | 无 |
| 参数 1 | :country 必选 |
| 参数 2 | ?city 可选 |
| 参数 3 | 无 |
| 脚本路径 | `./routes/embassy/index` |
| router.js 中的完整代码 | `router.get('/embassy/:country/:city?', require('./routes/embassy/index'));` |
| 类型 | 代码 |
| -------------------------- | ---------------------------------------------------------------------------- |
| 路由 | `/embassy/:country/:city?` |
| 数据来源 | embassy |
| 路由名称 ||
| 参数 1 | :country 必选 |
| 参数 2 | ?city 可选 |
| 参数 3 ||
| 脚本路径 | `./routes/embassy/index` |
| lib/router.js 中的完整代码 | `router.get('/embassy/:country/:city?', require('./routes/embassy/index'));` |

### 步骤 3: 添加脚本文档

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 38a90e2

Please sign in to comment.