A simple Node.js and AWS S3 app deployed using Defang.
- Download Defang CLI
- (Optional) If you are using Defang BYOC authenticate with your cloud provider account
- (Optional for local development) Docker CLI
To run the application locally, you can use the following command:
docker compose up --buildFor this sample, you will need to provide the following configuration:
Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you.
An API key to access AWS services.
defang config set AWS_ACCESS_KEYAn API key to access AWS services.
defang config set AWS_SECRET_KEYBelow is a useful command for testing.
curl -X POST -H 'Content-Type: application/json' -d '{ "first_name" : "jane", "last_name" : "doe" }' https://xxxxxx/upload
curl https://xxxxxx/downloadNote
Download Defang CLI
Deploy your application to the Defang Playground by opening up your terminal and typing:
defang compose upIf you want to deploy to your own cloud account, you can use Defang BYOC:
Title: Node.js & S3
Short Description: A simple Node.js application that uploads and downloads files from AWS S3.
Tags: Node.js, S3, AWS, JavaScript
Languages: nodejs