Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khaledomar77/image-processing-api
A simple project contain simple endpoint for image resizing using sharp image processing package and create a thumbnail for resized image -- Advanced full stack nanodegree
https://github.com/khaledomar77/image-processing-api
expressjs jasmine javascript nodejs supertest typescript
Last synced: 19 days ago
JSON representation
A simple project contain simple endpoint for image resizing using sharp image processing package and create a thumbnail for resized image -- Advanced full stack nanodegree
- Host: GitHub
- URL: https://github.com/khaledomar77/image-processing-api
- Owner: khaledomar77
- Created: 2022-12-20T17:16:33.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T20:12:39.000Z (11 months ago)
- Last Synced: 2024-11-05T18:55:42.262Z (2 months ago)
- Topics: expressjs, jasmine, javascript, nodejs, supertest, typescript
- Language: JavaScript
- Homepage:
- Size: 10.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image processing API
The main purpose of this project is to use an API endpoint used for image processing and resizing of input image using given image name, width and height. It is build using nodeJs,express and typescript language. The main idea of the project is to create an endpoint has GET type. It receives three input queries which are image name, width & height, then it integrates with sharp image processing library to create resized image based on user's output. It also integrates with express-validator library to check if the input is valid or not. Caching of resized images is implemented too. It's performed to avoid repeated creation of already existing resized image in /thumbnails folder. If the resized image exists, render the image wit no need to resave it.If not exist, save the image then render it.
## Simple diagram explains how the endpoint works:
![Untitled Diagram drawio](https://user-images.githubusercontent.com/56520041/216181191-4a4d46f0-2086-4345-9b42-4b375af34b51.png)you can install any dependencies using the following CLI command:
npm install dependency-name
you can install any dev-dependencies using the following CLI command:
npm install --save-dev dependency-nameall scripts and dependencies are in package.json
## Main Scripts:
### script for project setup:
npm install### script for developer's mode:
npm run dev### script for starting project:
npm start### script for compiling typescript to javascript:
npm run build### script for linting:
npm run lint
### script for code formatting:
npm run prettier.### script for run testing:
npm run test.### Main Link:
http://localhost:5000
the server is running on port 5000
### Endpoint:
http://localhost:3000/resize/
### Running Example:
http://localhost:3000/resize?image=fjord&width=500&height=500