Skip to content

Commit

Permalink
improved docs (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
remojansen authored Dec 7, 2017
1 parent 992ebd8 commit c610ba7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Some utilities for the development of express applications with Inversify.

You can install `inversify-express-utils` using npm:

```
$ npm install inversify inversify-express-utils reflect-metadata --save
```sh
npm install inversify inversify-express-utils reflect-metadata --save
```

The `inversify-express-utils` type definitions are included in the npm module and require TypeScript 2.0.
Expand Down Expand Up @@ -524,12 +524,14 @@ console.log(prettyjson.render({ routes: routeInfo }));
// ...
```

> :warning: Please ensure that you invoke `getRouteInfo` after invoking `server.build()`!
The output formatter by `prettyjson` looks as follows:

```txt
routes:
-
controller: Symbol(OrderController)
controller: OrderController
endpoints:
-
route: GET /api/order/
Expand All @@ -540,7 +542,7 @@ routes:
route:
- @requestParam id
-
controller: Symbol(UserController)
controller: UserController
endpoints:
-
route: GET /api/user/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inversify-express-utils",
"version": "5.1.0",
"version": "5.1.1",
"description": "Some utilities for the development of express applications with Inversify",
"main": "lib/index.js",
"jsnext:main": "es/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/debug.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { interfaces as inversifyInterfaces } from "inversify";
import { BaseHttpController } from "./base_http_controller";
import { interfaces } from "./interfaces";
import { PARAMETER_TYPE } from "./constants";
import { PARAMETER_TYPE, TYPE } from "./constants";
import {
getControllersFromContainer,
getControllerMetadata,
Expand All @@ -15,7 +15,7 @@ export function getRouteInfo(container: inversifyInterfaces.Container) {

const info = raw.map(r => {

const controllerId = Symbol.for(r.controllerMetadata.target.name).toString();
const controllerId = r.controllerMetadata.target.name;

const endpoints = r.methodMetadata.map(m => {

Expand Down
4 changes: 2 additions & 2 deletions test/debug.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ describe("Debug utils", () => {
}

const TYPES = {
OrderController: Symbol.for(OrderController.name).toString(),
UserController: Symbol.for(UserController.name).toString()
OrderController: OrderController.name,
UserController: UserController.name
};

let server = new InversifyExpressServer(container);
Expand Down

0 comments on commit c610ba7

Please sign in to comment.