Skip to content

Commit 05bbc25

Browse files
committed
fix: prettier
1 parent 3b6c3a3 commit 05bbc25

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+255
-408
lines changed

README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ You can use routing-controllers with [express.js][1] or [koa.js][2].
8888
and make sure to import it before you use routing-controllers:
8989

9090
```typescript
91-
9291
```
9392

9493
3. Install framework:
@@ -165,7 +164,7 @@ In prior versions, these were direct dependencies, but now they are peer depende
165164
2. Create a file `app.ts`
166165

167166
```typescript
168-
// this shim is required
167+
// this shim is required
169168
import { createExpressServer } from 'routing-controllers';
170169
import { UserController } from './UserController';
171170

@@ -301,7 +300,6 @@ If you have, or if you want to create and configure express app separately,
301300
you can use `useExpressServer` instead of `createExpressServer` function:
302301

303302
```typescript
304-
305303
import { useExpressServer } from 'routing-controllers';
306304

307305
let express = require('express'); // or you can import it if you have installed typings
@@ -322,7 +320,6 @@ You can load all controllers from directories, by specifying array of directorie
322320
`createExpressServer` or `useExpressServer`:
323321

324322
```typescript
325-
326323
import { createExpressServer } from 'routing-controllers';
327324

328325
createExpressServer({
@@ -337,7 +334,6 @@ createExpressServer({
337334
If you want to prefix all your routes, e.g. `/api` you can use `routePrefix` option:
338335

339336
```typescript
340-
341337
import { createExpressServer } from 'routing-controllers';
342338
import { UserController } from './controller/UserController';
343339

@@ -774,7 +770,6 @@ Since CORS is a feature that is used almost in any web-api application,
774770
you can enable it in routing-controllers options.
775771

776772
```typescript
777-
778773
import { createExpressServer } from 'routing-controllers';
779774
import { UserController } from './UserController';
780775

@@ -791,7 +786,6 @@ For express its `npm i cors`, for koa its `npm i kcors`.
791786
You can pass cors options as well:
792787

793788
```typescript
794-
795789
import { createExpressServer } from 'routing-controllers';
796790
import { UserController } from './UserController';
797791

@@ -810,7 +804,6 @@ app.listen(3000);
810804
You can override default status code in routing-controllers options.
811805

812806
```typescript
813-
814807
import { createExpressServer } from 'routing-controllers';
815808
import { UserController } from './UserController';
816809

@@ -894,7 +887,6 @@ For example, lets try to use [compression](https://github.com/expressjs/compress
894887
4. If you want to use compression module globally for all controllers you can simply register it during bootstrap:
895888

896889
```typescript
897-
898890
import { createExpressServer } from 'routing-controllers';
899891
import { UserController } from './UserController'; // we need to "load" our controller before call createExpressServer. this is required
900892
let compression = require('compression');
@@ -1053,7 +1045,6 @@ export class LoggingMiddleware implements ExpressMiddlewareInterface {
10531045
To enable this middleware, specify it during routing-controllers initialization:
10541046

10551047
```typescript
1056-
10571048
import { createExpressServer } from 'routing-controllers';
10581049
import { UserController } from './UserController';
10591050
import { LoggingMiddleware } from './LoggingMiddleware';
@@ -1097,7 +1088,6 @@ createExpressServer({
10971088
Also you can load middlewares from directories. Also you can use glob patterns:
10981089

10991090
```typescript
1100-
11011091
import { createExpressServer } from 'routing-controllers';
11021092
createExpressServer({
11031093
controllers: [__dirname + '/controllers/**/*.js'],
@@ -1187,7 +1177,6 @@ You have ability to do this using [class-transformer][4].
11871177
To use it simply specify a `classTransformer: true` option on application bootstrap:
11881178

11891179
```typescript
1190-
11911180
import { createExpressServer } from 'routing-controllers';
11921181

11931182
createExpressServer({
@@ -1259,7 +1248,6 @@ E.g. `class-transformer` doesn't check whether the property's types are correct,
12591248
It can be done easily thanks to integration with [class-validator][9]. This behaviour is **enabled** by default. If you want to disable it, you need to do it explicitly e.g. by passing `validation: false` option on application bootstrap:
12601249

12611250
```typescript
1262-
12631251
import { createExpressServer } from 'routing-controllers';
12641252

12651253
createExpressServer({
@@ -1318,7 +1306,6 @@ Routing-controllers comes with two decorators helping you to organize authorizat
13181306
To make `@Authorized` decorator to work you need to setup special routing-controllers options:
13191307

13201308
```typescript
1321-
13221309
import { createExpressServer, Action } from 'routing-controllers';
13231310

13241311
createExpressServer({
@@ -1360,7 +1347,6 @@ export class SomeController {
13601347
To make `@CurrentUser` decorator to work you need to setup special routing-controllers options:
13611348

13621349
```typescript
1363-
13641350
import { createExpressServer, Action } from 'routing-controllers';
13651351

13661352
createExpressServer({
@@ -1397,7 +1383,6 @@ middlewares and error handlers. Container must be setup during application boots
13971383
Here is example how to integrate routing-controllers with [typedi](https://github.com/typestack/typedi):
13981384

13991385
```typescript
1400-
14011386
import { createExpressServer, useContainer } from 'routing-controllers';
14021387
import { Container } from 'typedi';
14031388

docs/lang/chinese/READEME.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
并确认在使用 routing-controllers 前引入
8888

8989
```typescript
90-
9190
```
9291

9392
3. 安装框架:
@@ -164,7 +163,7 @@
164163
2. 新建文件 `app.ts`
165164

166165
```typescript
167-
// 引入必要库
166+
// 引入必要库
168167
import { createExpressServer } from 'routing-controllers';
169168
import { UserController } from './UserController';
170169

@@ -287,7 +286,6 @@ export class UserController {
287286
需要自行创建 express 应用并单独配置,可以用 `useExpressServer` 代替 `createExpressServer`
288287

289288
```typescript
290-
291289
import { useExpressServer } from 'routing-controllers';
292290

293291
let express = require('express'); // 或者引入类型声明
@@ -307,7 +305,6 @@ app.listen(3000); // 运行express服务
307305
`createExpressServer``useExpressServer` 中指定文件夹,即可加载该目录下所有控制器:
308306

309307
```typescript
310-
311308
import { createExpressServer } from 'routing-controllers';
312309

313310
createExpressServer({
@@ -322,7 +319,6 @@ createExpressServer({
322319
要为所有路由添加前缀,比如 `/api`,可以使用 `routePrefix` 配置项:
323320

324321
```typescript
325-
326322
import { createExpressServer } from 'routing-controllers';
327323
import { UserController } from './controller/UserController';
328324

@@ -757,7 +753,6 @@ class DbError extends HttpError {
757753
跨域是目前大部分 web-api 应用使用的特性,配置 routing-controllers 允许跨域:
758754

759755
```typescript
760-
761756
import { createExpressServer } from 'routing-controllers';
762757
import { UserController } from './UserController';
763758

@@ -774,7 +769,6 @@ express 用户需要 `npm i cors`,Koa 用户需要 `npm i kcors`。
774769
可以如下例进行配置:
775770

776771
```typescript
777-
778772
import { createExpressServer } from 'routing-controllers';
779773
import { UserController } from './UserController';
780774

@@ -793,7 +787,6 @@ app.listen(3000);
793787
在 routing-controllers 配置中覆写默认状态码。
794788

795789
```typescript
796-
797790
import { createExpressServer } from 'routing-controllers';
798791
import { UserController } from './UserController';
799792

@@ -858,7 +851,6 @@ app.listen(3000);
858851
4. 要全局使用 compression 模块,可以在服务引导时注册中间件:
859852

860853
```typescript
861-
862854
import { createExpressServer } from 'routing-controllers';
863855
import { UserController } from './UserController';
864856
// 必须在调用createExpressServer前加载控制器
@@ -1017,7 +1009,6 @@ export class LoggingMiddleware implements ExpressMiddlewareInterface {
10171009
必须在 routing-controllers 初始化时指定要使用的全局中间件:
10181010

10191011
```typescript
1020-
10211012
import { createExpressServer } from 'routing-controllers';
10221013
import { UserController } from './UserController';
10231014
import { LoggingMiddleware } from './LoggingMiddleware';
@@ -1061,7 +1052,6 @@ createExpressServer({
10611052
从文件夹加载中间件。可以使用 glob patterns 匹配模式:
10621053

10631054
```typescript
1064-
10651055
import { createExpressServer } from 'routing-controllers';
10661056
createExpressServer({
10671057
controllers: [__dirname + '/controllers/**/*.js'],
@@ -1150,7 +1140,6 @@ export class NameCorrectionInterceptor implements InterceptorInterface {
11501140
需要在服务引导时配置 `classTransformer: true` 开启该功能:
11511141

11521142
```typescript
1153-
11541143
import { createExpressServer } from 'routing-controllers';
11551144

11561145
createExpressServer({
@@ -1194,7 +1183,6 @@ export class UserController {
11941183
感谢 [class-validator][9] 我们可以轻松实现这一需求。该功能默认 _开启_。如果要关闭,在应用引导时配置 `validation: false`
11951184

11961185
```typescript
1197-
11981186
import { createExpressServer } from 'routing-controllers';
11991187

12001188
createExpressServer({
@@ -1251,7 +1239,6 @@ Routing-controllers 附带两个装饰器实现在应用中的鉴权。
12511239
使用 `@Authorized` 装饰器需要配置 routing-controllers:
12521240

12531241
```typescript
1254-
12551242
import { createExpressServer, Action } from 'routing-controllers';
12561243

12571244
createExpressServer({
@@ -1292,7 +1279,6 @@ export class SomeController {
12921279
使用 `@CurrentUser` 装饰器需要配置 routing-controllers:
12931280

12941281
```typescript
1295-
12961282
import { createExpressServer, Action } from 'routing-controllers';
12971283

12981284
createExpressServer({
@@ -1328,7 +1314,6 @@ export class QuestionController {
13281314
这里展示如何整合 [typedi](https://github.com/pleerock/typedi) 到 routing-controllers:
13291315

13301316
```typescript
1331-
13321317
import { createExpressServer, useContainer } from 'routing-controllers';
13331318
import { Container } from 'typedi';
13341319

sample/sample1-simple-controller/UserController.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { Request } from 'express';
32
import { Controller } from '../../src/decorator/Controller';
43
import { Get } from '../../src/decorator/Get';

sample/sample1-simple-controller/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { createExpressServer } from '../../src/index';
32

43
require('./UserController');

sample/sample11-complete-sample-express/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { createExpressServer } from '../../src/index';
32

43
// base directory. we use it because file in "required" in another module

sample/sample12-session-support/UserController.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { Request } from 'express';
32
import { Controller } from '../../src/decorator/Controller';
43
import { Get } from '../../src/decorator/Get';

sample/sample12-session-support/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { useExpressServer } from '../../src/index';
32
import * as express from 'express';
43
import * as session from 'express-session';

sample/sample13-koa-views-render/BlogController.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { Controller } from '../../src/decorator/Controller';
32
import { Get } from '../../src/decorator/Get';
43
import { Render } from '../../src/decorator/Render';

sample/sample13-koa-views-render/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import * as Koa from 'koa';
32

43
import { useKoaServer } from '../../src/index';

sample/sample14-custom-decorator/QuestionController.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { Get } from '../../src/decorator/Get';
32
import { JsonController } from '../../src/decorator/JsonController';
43
import { UserFromSession } from './UserFromSession';

0 commit comments

Comments
 (0)