> For the complete documentation index, see [llms.txt](https://microservice-nodejs.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://microservice-nodejs.shujuwajue.com/egg.js/lu-you.md).

# 路由 / 传值 / 模板引擎

### 1、Egg 路由配置&#x20;

<https://eggjs.org/zh-cn/basics/router.html>

### 2、获取 Get 传值以及动态路由的值

<https://eggjs.org/zh-cn/basics/controller.html#%E8%8E%B7%E5%8F%96-http-%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0>

&#x20;<https://eggjs.org/zh-cn/basics/controller.html>

### 3、egg-view-ejs 的使用

<https://github.com/eggjs/egg-view-ejs>

其他：<https://eggjs.org/zh-cn/core/view.html>

**1. 安装**

```
npm i egg-view-ejs --save
```

**2. 找到** `{app_root}/config/plugin.js`

```javascript
exports.ejs = {
    enable: true,
    package: 'egg-view-ejs',
};
```

&#x33;**. 找到** `{app_root}/config/config.default.js`

```javascript
module.exports = appInfo => {

const config = exports = {};

// use for cookie sign key, should change to your own and keep security
config.keys = appInfo.name + '_1532498393023_7447';

// add your config here
config.middleware = [];

//配置 ejs 模板引擎
config.view = {
    mapping: {
        '.html': 'ejs',
    }
};
    return config;
};
```
