Skip to content

Commit

Permalink
fix(common): Deprecate $onMountingMiddleware. Use $beforeRoutesInit i…
Browse files Browse the repository at this point in the history
…nstead
  • Loading branch information
Romakita committed Aug 20, 2019
1 parent a2c7e8e commit b7b3132
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
23 changes: 19 additions & 4 deletions docs/tutorials/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,31 @@ You need to create three files:
- One for the local development, for example "index.js" (that you can use to run the app locally with `ts-node local.ts`)

Create the server and add the aws middleware:

<<< @/docs/tutorials/snippets/aws/server-configuration.ts

Then create the lambda.ts:

<<< @/docs/tutorials/snippets/aws/lambda.ts

And finally create an index.ts to run your server in development mode:
```typescript
// local.js
import {Server} from "./Server.js";


import {$log, ServerLoader} from "@tsed/common";
import {Server} from "./Server";

async function bootstrap() {
try {
$log.debug("Start server...");
const server = await ServerLoader.bootstrap(Server);

await server.listen();
$log.debug("Server initialized");
} catch (er) {
$log.error(er);
}
}

bootstrap();
```
::: tip
You can find a project example with [AWS configurattion here](https://github.com/TypedProject/tsed-example-aws).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe("ServerLoader", () => {
}

$onMountingMiddlewares() {
// deprecated
}

$afterRoutesInit() {
Expand Down

0 comments on commit b7b3132

Please sign in to comment.