Giter Site home page Giter Site logo

aws-s3-image-service-beanstalk's Introduction

aws-s3-image-service-beanstalk

this is a nodejs project comply with aws beanstalk protocal. A backend service to upload image to aws s3 and resize image on the fly. you can test it by postman. you need AWS credential with permission to access s3, EC2, beanstalk writting and so on...


Requirements

For development, you need Node.js and npm installed in your environement. also please install Elastic Beanstalk Command Line Interface (EB CLI)
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html

Node

  • Node installation on Windows

    Just go on official Node.js website and download the installer. Also, be sure to have git available in your PATH, npm might need it (You can find git here).

  • Node installation on Ubuntu

    You can install nodejs and npm easily with apt install, just run the following commands.

    $ sudo apt install nodejs
    $ sudo apt install npm
    
  • Other Operating Systems

    You can find more information about the installation on the official Node.js website and the official NPM website.

If the installation was successful, you should be able to run the following command.

$ node --version
v12.18.1

$ npm --version
6.14.5

If you need to update npm, you can make it using npm! Cool right? After running the following command, just open again the command line and be happy.

$ npm install npm -g

Install

$ git clone [email protected]:shawnwz/aws-s3-image-service-beanstalk.git
$ cd aws-s3-image-service-beanstalk
$ npm install

Configure app

create and open .env then edit it with your settings. You will need:

  ACCESS_KEY_ID=xxxxxxxxxx
  SECRET_ACCESS_KEY=xxxxxxxxxx
  REGION=us-east-1
  BUCKET_NAME=xxxxxxxxxx
  PORT=3000

Running the project

$ npm start

Simple build for production

according to https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html
first to create eb env
eg:
$ eb init --platform node.js --region us-east-2
$ eb create --sample node-express-env
$ eb deploy

Test with PostMan

Upload:
  POST:  http://yourpath.elasticbeanstalk.com/api/upload
    in the body must has a KEY named folder indicates the upload folder
    mush has a KEY named image1 (file) indicates the first image
    optional has a KEY named image2 (file) the second image
GET/resize the image
  GET:  http://yourpath.elasticbeanstalk.com/api/get/thename.png?width=200
  this will return resized image binary.

aws-s3-image-service-beanstalk's People

Contributors

mm-zhe avatar shawnwz avatar

Watchers

 avatar

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.