Skip to content

Commit

Permalink
docs(example-getting-started): remove controller refs from juggler.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kjdelisle committed Mar 2, 2018
1 parent 1f82b10 commit fca6899
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions packages/example-getting-started/docs/juggler.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ on those sources of data.
It also provides many of the functions and interfaces we'll require for setting
up our new LoopBack application, which is why we're starting here.

The application template comes with a controller, and some default wireup in
`src/application.ts` that handles the basic configuration for your application.
For this tutorial, we won't need `ping.controller.ts` or its corresponding test,
but you can leave them in for now.

Now that you have your setup, it's time to modify it to add in
`@loopback/repository`. Install this dependency by running
`npm i --save @loopback/repository`.
Expand All @@ -26,17 +21,33 @@ the `RepositoryMixin`:
```ts
import {ApplicationConfig} from '@loopback/core';
import {RestApplication} from '@loopback/rest';
import {PingController} from './controllers/ping-controller';
import {Class, Repository, RepositoryMixin} from '@loopback/repository';

export class TodoApplication extends RepositoryMixin(RestApplication) {
/* tslint:disable:no-unused-variable */
// Do not remove!
// Class and Repository imports required to infer types in consuming code!
// Binding and Booter imports are required to infer types for BootMixin!
import {BootMixin, Booter, Binding} from '@loopback/boot';
import {
Class,
Repository,
RepositoryMixin,
} from '@loopback/repository';
/* tslint:enable:no-unused-variable */
export class TodoApplication extends BootMixin(
RepositoryMixin(RestApplication),
) {
constructor(options?: ApplicationConfig) {
super(options);
this.setupControllers();
}

setupControllers() {
this.controller(PingController);
this.projectRoot = __dirname;
// Customize @loopback/boot Booter Conventions here
this.bootOptions = {
controllers: {
// Customize ControllerBooter Conventions here
dirs: ['controllers'],
extensions: ['.controller.js'],
nested: true,
},
};
}
}
```
Expand Down

0 comments on commit fca6899

Please sign in to comment.