Git Product home page Git Product logo

aws-node-signed-uploads's Introduction

AWS Node Signed Uploads

codecov Build Status

Requirements

  • Node.js >= 6.9.1
  • npm >= 3.10.8

Welcome

If you have landed to this project out of curiosity for the technologies behind the service, you can see implementation details in this article.

The approach implemented in this service is useful when you want to use Amazon API Gateway and you want to solve the 10MB payload limit.

The service is based on the serverless framework. The service is uploading objects to a specific S3 bucket using a pre-signed URL. Implemented in node.js runtime using getSignedUrl method.

The package is targeting the latest runtime of AWS Lambda. (8.10)

Prerequisites

  1. Create config.json

Example is provided in config.example.json.

  1. Create a bucket for the file uploads

The name of the folder should be matching bananabucket-${self:provider.stage}, where ${self:provider.stage} is dynamically calculated based on the settings of config.json.

Of course you can also change the name of environment variable completely from BUCKET: bananabucket-${self:provider.stage}, but where's the fun of not having a bananabucket?

File name to sign

The file you want to upload is signed via x-amz-meta-filekey header.

Integrations

Here's a short list of possible integrations I found making a quick Google search:

How to use

Get dependencies with yarn or npm install. The following examples will assume the usage of yarn.

Tests

Running all tests:

$ yarn test

Developing tests:

$ npx jest --watch

Develop locally

Starting a local dev server and its endpoint for receiving uploads:

$ yarn start

Linter

Starting the linter tasks:

$ yarn lint

Deployment

Setup your AWS credentials.

Run the following the fire the deployment:

$ yarn deploy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.