Statistics
| Branch: | Tag: | Revision:

mongoose / examples / restful_server_s3 / README.md @ eaef5bd1

History | View | Annotate | Download (1.06 KB)

1
RESTful server with Amazon S3 upload example
2
============================================
3

    
4
This example demonstrates how Mongoose could be used to implement a RESTful
5
service that uses another RESTful service to handle it's own API call.
6
This example takes form data and uploads it as a file to Amazon S3.
7

    
8
## Prerequisites
9

    
10
- Amazon S3 account security credentials: Access Key ID and Secret Access
11
  Key ID. Get them from the Amazon IAM console.
12
- Amazon S3 bucket.
13

    
14
## Building and running the example
15

    
16
    $ git clone https://github.com/cesanta/mongoose.git
17
    $ cd mongoose/examples/restful_server_s3
18
    $ make
19
    $ ./restful_server_s3 -a ACCESS_KEY_ID -s SECRET_ACCESS_KEY_ID
20
    Starting RESTful server on port 8000
21

    
22
Then, open a browser on `http://localhost:8000`
23

    
24
Note: If you're getting a *Temporary Redirect* error, look what is the
25
Endpoint value is. It's likely that you have something like
26
`BUCKET_NAME.S3_ZONE.amazonaws.com`.
27
Change the *Host* field to `S3_ZONE.amazonaws.com and retry`.
28

    
29
## Screenshot
30

    
31
![](https://docs.cesanta.com/images/mongoose_s3_example.png)