A simple image processing microservice, as part of the Udacity Cloud Developer Nanodegree. It is a Node-Express application that resizes the image and runs it through a greyscale filter. The application is intended to be deployed on AWS Elastic Beanstalk.
Before getting started, make sure Node.js is downloaded and installed. The latest version of Node.js can be downloaded from nodejs.org and it's recommended to use the LTS version.
It is recommended to use the AWS CLI for managing and configuring AWS. Installation instructions can be found here and details on configuring AWS credentials can be found here.
Elastic Beanstalk CLI is used for creating and deploying to your Elastic Beanstalk environment. Installation instructions can be found here.
The application runs as a node server. Open a new terminal within the project directory and run:
- Install dependencies:
npm i
- Run the development server:
npm run dev
Note: Default URL for the development server will be http://localhost:{{PORT}}/
.
- Initialize an EB CLI project
- Create deployable build
- Create new environment
- Deploy changes
Note: URL for the Elastic Beanstalk server can be found on the EB application dashboard (See deployment screenshot).
Run eb init
, in the project folder, to initialize an EB CLI project for the first time.
Once completed, open .easticbeanstalk/config.yml
, from within the project folder, and add the following:
deploy:
artifact: ./www/Archive.zip
To create a deployable build and produce an Archive.zip file in the build directory, run npm run build
.
Run eb create
to create a new EB environment and push the initial build of the application.
Note: A deploayble build must be created before creating a new EB environment
Changes to th application can be deployed using eb deploy
.
GET /
Simply returns a message with usage instructions.
GET /filteredimage?image_url={{}}
Requires the url of an image. The image will be resized, run through a greyscale filter and the new image returned as a JPEG.
Example:
http://localhost:{{PORT}}/filteredimage?image_url=https://timedotcom.files.wordpress.com/2019/03/kitten-report.jpg
This project was bootstrapped with the Udacity Image Filter Starter Code.