Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tsed/platform-aws

Package Overview
Dependencies
Maintainers
1
Versions
446
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsed/platform-aws

Module to support AWS function with Ts.ED

  • 6.102.8-rc.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4K
increased by813.99%
Maintainers
1
Weekly downloads
 
Created
Source

Ts.ED logo

Platform AWS

Build & Release PR Welcome Coverage Status npm version semantic-release code style: prettier backers

Website   •   Getting started   •   Slack   •   Twitter

IMPORTANT: This package is deprecated in favor of @tsed/platform-serverless-http or @tsed/platform-serverless. Please don't use this package for new project!

A package of Ts.ED framework. See website: https://tsed.io/tutorials/aws.html

Installation

Run npm command (or yarn):

npm install --save @tsed/platform-aws

Usage

Create a new LambdaServer.ts in src directory:

import {PlatformAws} from "@tsed/platform-aws";
import "@tsed/platform-express";
// or import "@tsed/platform-koa"

PlatformAws.bootstrap(Server, {
  aws: {
    binaryMimeTypes: [
      // optional
      // mime types list
    ]
  }
  // additional Ts.ED options. See https://tsed.io/tutorials/aws.html
});

// Handler used by AWS
export const handler = PlatformAws.callback();

Then create lambda.js on your root project:

module.exports = require("./dist/LambdaServer.js");

This file will be used by AWS to forward request to your application.

Finally, package and create your Lambda function, then configure a simple proxy API using Amazon API Gateway and integrate it with your Lambda function.

See more details on aws-serveless-express project.

Getting the API Gateway event object

This package includes decorators to easily get the event object Lambda received from API Gateway:

import {Controller, Get} from "@tsed/common";
import {AwsEvent, AwsContext} from "@tsed/platform-aws";

@Controller("/")
class MyCtrl {
  @Get("/")
  get(@AwsEvent() event: any, @AwsContext() context: any) {
    console.log("Event", apiGateway.event);
    console.log("Context", apiGateway.context);

    return apiGateway;
  }
}

Contributors

Please read contributing guidelines here

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

The MIT License (MIT)

Copyright (c) 2016 - 2018 Romain Lenzotti

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Package last updated on 20 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc