Creates an AWS EC2 Instance running NodeJS and associated AWS resources for the "usefulapi" service. Please note that I am not following best practices for security because I am only using the default subnet and VPC with only 1 instance and no auto scaling. I could also force everyone to use the ELB but am not.
To house all of my one-off API ideas.
- Run the Cloudformation template using either the CLI or AWS console: EC2Instance-usefulAPI.yaml
- Please note that the startup script will take some time to run and is still running after the stack is finished creating. I noticed that about 5 minutes should be enough time before you try hitting the API. If the ELB does not work at first, give it a few minutes because it is being set to InService after the CFN is done.
- convert:
- Converts an Image to Base64
- Endpoint:
POST http://UsefulAPI-Instance-16INGOG725HYN-1316259238.us-east-1.elb.amazonaws.com/convert
- Body:
Upload the image as multipart/form-data with no JSON body
- Response:
{ "image": { "filename": "image.jpg", "contentType": "image/jpeg", "base64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/..." } }
- If you would like to make edits, please create a pull request or make an new issue.
- Andrew Tomko
- [email protected]