Coder Social home page Coder Social logo

apoca / lambda-resize-image Goto Github PK

View Code? Open in Web Editor NEW
59.0 6.0 12.0 4.56 MB

An AWS Lambda Function to resize images automatically with API Gateway and S3 for imagemagick tasks. When an image is called on AWS Api Gateway, this package will resize it and send it to the S3.

Home Page: https://github.com/apoca/lambda-resize-image

License: MIT License

JavaScript 98.46% Shell 1.54%
lambda serverless aws-lambda aws-s3 imagemagick nodejs cdn sharp

lambda-resize-image's People

Contributors

apoca avatar codacy-badger avatar dependabot[bot] avatar franciscomorais avatar joelcalheiros avatar miguelangelorodrigues avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lambda-resize-image's Issues

Something wrong with regex getImageKey

2018-10-10T15:27:48.232Z 0ad4817a-cca1-11e8-b8ac-6df64c340e00 TypeError: Cannot read property '0' of null at /var/task/src/handler.js:1:3502 at h (/var/task/src/handler.js:1:3506)

Support different Domains paths

I am facing an issue with domains with the path (basename). Our script only support one level:

Example: http://api.example.com/<YOU_KEY_NAME_S3_HERE>?width=150&height=150

const path = event.path;
const imageKey = url.parse(path).pathname.replace(/^\//g, '');

The above code with "replace" will work as supposed. But, whether we have more than the YOU_KEY_NAME_S3_HERE, as http://api.example.com/development/service/<YOU_KEY_NAME_S3_HERE>?width=150&height=150 we'll get an error. Obviously, because our url have more than the KEY_NAME, it have also "development/service/".

Remove redirect from handler

This repository is working well for the first version. However, after some time our website is growing and we are facing now some issues with the speed page, we have implemented the CDN, but we have some issues with redirects...

resolve({
      statusCode: 301,
      headers: {
        Location: `${process.env.URL}/${key}`
      }
});

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.