Skip to content

Commit

Permalink
fix(example-getting-started): update readme to use RestApplication (#961
Browse files Browse the repository at this point in the history
)
  • Loading branch information
shimks authored Feb 5, 2018
1 parent 3829878 commit b3e2c0e
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions packages/example-getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,13 @@ the `RepositoryMixin`:

#### src/application.ts
```ts
import {Application, ApplicationConfig} from '@loopback/core';
import {RestComponent} from '@loopback/rest';
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(Application) {
export class TodoApplication extends RepositoryMixin(RestApplication) {
constructor(options?: ApplicationConfig) {
// Allow options to replace the defined components array, if desired.
options = Object.assign(
{},
{
components: [RestComponent],
},
options,
);
super(options);
this.setupControllers();
}
Expand Down Expand Up @@ -356,8 +348,8 @@ as adding in our new controller binding.

#### src/application.ts
```ts
import {Application, ApplicationConfig} from '@loopback/core';
import {RestComponent} from '@loopback/rest';
import {ApplicationConfig} from '@loopback/core';
import {RestApplication} from '@loopback/rest';
import {TodoController, PingController} from './controllers';
import {
Class,
Expand All @@ -368,16 +360,8 @@ import {
import {db} from './datasources/db.datasource';
import {TodoRepository} from './repositories';

export class TodoApplication extends RepositoryMixin(Application) {
export class TodoApplication extends RepositoryMixin(RestApplication) {
constructor(options?: ApplicationConfig) {
// Allow options to replace the defined components array, if desired.
options = Object.assign(
{},
{
components: [RestComponent],
},
options,
);
super(options);
this.setupControllers();
this.setupRepositories();
Expand Down

0 comments on commit b3e2c0e

Please sign in to comment.