Skip to content

Fetch and upload image to S3 using Serverless framework

Notifications You must be signed in to change notification settings

dev-jotape/upload-image-s3

Repository files navigation

Upload image to S3 - Serverless Framework (AWS)

API created for fetch an image and upload to a S3 bucket.

Get started

Install

yarn npm install

Create .env

Use the env.example to create an .env file.

Deploy

serverless deploy

Test

npm run test

ESlint

npm run lint

Usage

Register

POST https://hgdek56d34.execute-api.us-east-1.amazonaws.com/prod/register

Body:

{
    "email": "[email protected]",
    "password": "test123",
    "name": "Test"
}

Login

POST https://hgdek56d34.execute-api.us-east-1.amazonaws.com/prod/login

{
    "email": "[email protected]",
    "password": "test123"
}

Upload Image

POST https://hgdek56d34.execute-api.us-east-1.amazonaws.com/prod/images

Header:

Authorization: Bearer ACCESS_TOKEN

Body:

{
    "image_url": "https://github.githubassets.com/images/modules/open_graph/github-mark.png",
    "key": "github.png"
}

About

Fetch and upload image to S3 using Serverless framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published