Skip to content

A simple Spray service to upload images to S3 bucket

License

Notifications You must be signed in to change notification settings

victorfranz/img-upload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

img-upload Build Status Codecov MIT licensed

A simple Spray service to upload images to S3 bucket

Configuration:

src/main/resources/application.conf

imgupload { bucketName = "YOUR S3 BUCKET NAME" imgEndpoint = "YOUR S3 Static site endpoint or any other custom URL that provide access to your S3 files" AWS_ACCESS_KEY = "YOUR AWS_ACCESS_KEY" AWS_SECRET_KEY = "YOUR AWS_SECRET_KEY" sizeLimit = 2 // size limit in MB }

Run:

sbt run

Example of usage:

curl -i -F "[email protected]" http://127.0.0.1:8080/

< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Thu, 28 Apr 2016 03:19:42 GMT
Date: Thu, 28 Apr 2016 03:19:42 GMT
< Content-Type: application/json; charset=UTF-8
Content-Type: application/json; charset=UTF-8
< Content-Length: 109
Content-Length: 109
 Connection #0 to host 127.0.0.1 left intact
{"url":"http://yourbucket.s3-website-sa-east-1.amazonaws.com/faef6e44-05ef-416c-a392-a8b388e4258b_test.png"}

curl http://127.0.0.1:8080/

> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 127.0.0.1:8080
> Accept: */*
> Referer: rbose
> 
< HTTP/1.1 200 OK
< Date: Thu, 28 Apr 2016 03:18:54 GMT
< Content-Type: application/json; charset=UTF-8
< Content-Length: 162
< 
* Connection #0 to host 127.0.0.1 left intact
{"builtAtMillis":"1461813488487", "name":"img-upload", "scalaVersion":"2.11.2", "version":"0.1", "sbtVersion":"0.13.6", "builtAtString":"2016-04-28 03:18:08.487"}

About

A simple Spray service to upload images to S3 bucket

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages