Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.

stanislaw-glogowski/apex-typescript-example

Repository files navigation

Apex TypeScript Example

Setup

To run the example first setup your AWS credentials. You also need to install apex and Terraform cli.

Installation

$ git clone https://github.com./stanislaw-glogowski/apex-typescript-example.git && cd ./apex-typescript-example
$ npm install
$ apex infra apply # creating lambda role
$ apex deploy
$ apex infra apply # creating api gateway

Invoke functions

You can test your lambda function using apex cli

$ apex invoke lambda_with_api_gateway_event < ./events/api-gateway.json

output:

{
  "statusCode": 200,
  "headers": {
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Allow-Credentials": true,
    "Content-Type": "application/json"
  },
  "body": "{\"method\":\"GET\"}"
}

In addition, lambda_with_api_gateway_event is integrated with API Gateway in infrastructure configuration. After successful installation there should be apex-typescript-example_api_gateway api, available from AWS console.

Destroying

$ apex infra destroy # destroying infrastructure
$ apex infra apply   # creating lambda role (needed for deleting lambdas)
$ apex delete        # deleting lambdas
$ apex infra destroy # final infrastructure destroying

License

The MIT License

About

Apex TypeScript example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published