8.9.2 • Published 5 months ago

@typeix/resty-aws-lambda v8.9.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@typeix/resty Typescript framework for Node.js

Build Status Coverage Status npm

Starters

  • TBD

Example Usage

import {
  Controller, Inject, ResolvedRoute, 
  GET, POST, OnError, RootModule, Logger, Router
} from "@typeix/resty";
import {lambdaServer} from "@typeix/resty-aws-lambda";

// define controller
@Controller({
  path: "/"
})
class HomeController {

  @Inject()
  private request: IncomingMessage;

  @Inject()
  private response: ServerResponse;

  @ResolvedRoute()
  private route: IResolvedRoute;

  @GET()
  actionGet() {
    return this.route.method.toUpperCase() + " ACTION";
  }

  @POST()
  actionAjax(@RequestBody() body: Buffer) {
    return JSON.stringify(body.toString());
  }

  @OnError("*")
  errorCase() {
    return "FIRE ERROR CASE";
  }

  @GET("redirect")
  actionRedirect() {
    this.response.setHeader("Location", "/mypage");
    this.response.writeHead(307);
    this.response.end();
  }
}

// DEFINE MODULE 
@RootModule({
  imports: [], // here you can import other modules
  shared_providers: [
    {
      provide: Logger,
      useFactory: () => new Logger(Logger.defaultConfig("info"))
    },
    Router
  ],
  providers: [],
  controllers: [HomeController]
})
class ApplicationModule {}

// CREATE SERVER
export const handler = lambdaServer(ApplicationModule);
8.9.2

5 months ago

8.9.1

5 months ago

8.8.0

6 months ago

8.8.0-rc.1

6 months ago

8.6.1-rc.0

1 year ago

8.6.1-rc.1

1 year ago

8.7.0

1 year ago

8.6.0

2 years ago

8.5.2-rc.1

2 years ago

8.5.2-rc.2

2 years ago

8.4.5

2 years ago

8.4.4

2 years ago

8.4.6

2 years ago

8.4.1

2 years ago

8.4.0

2 years ago

8.4.3

2 years ago

8.4.2

2 years ago

8.5.0

2 years ago

8.5.1

2 years ago

8.3.0-rc.1

2 years ago

8.3.0

2 years ago

8.2.4

3 years ago

8.2.4-rc.2

3 years ago

8.2.3

3 years ago

8.2.2

3 years ago

8.1.3

3 years ago

8.2.1

3 years ago

8.2.0

3 years ago

8.1.2

4 years ago

8.1.2-rc.2

4 years ago

8.1.1

4 years ago

8.1.1-rc.3

4 years ago

8.1.1-rc.2

4 years ago

8.1.1-rc.0

4 years ago

8.1.0

4 years ago

8.1.0-rc.2

4 years ago

8.1.0-rc.1

4 years ago

8.1.0-rc.0

4 years ago

8.0.7

4 years ago

8.0.7-rc.2

4 years ago

8.0.7-rc.1

4 years ago

8.0.6

4 years ago

8.0.2

4 years ago

8.0.1

4 years ago

8.0.0

4 years ago

8.0.1-beta.0

4 years ago

8.0.0-beta.0

4 years ago

8.0.0-alpha.2.1

4 years ago

8.0.0-y.0

4 years ago

8.0.0-alpha.1

4 years ago

8.0.3-alpha.3

4 years ago

8.0.3-alpha.2

4 years ago

8.0.3-alpha.1

4 years ago

8.0.3-alpha.0

4 years ago

8.0.2-alpha.0

4 years ago

8.0.1-alpha.0

4 years ago

8.0.0-alpha.0

4 years ago

7.4.1

4 years ago

7.4.1-alpha.3

4 years ago

7.4.1-alpha.2

4 years ago

7.4.1-alpha.1

4 years ago

7.4.1-alpha.0

4 years ago

7.4.0

4 years ago

7.4.0-alpha.1

4 years ago