- Use current node version from
.nvmrc
file$> nvm install
, or make sure you've at least Node 12.x installed - Next run
$> npm install
- Start Dev server with
$> npm run dev
- Open the sample HTML example in browser.
examples/frontend/simple-resize.html
- For Production ready build:
$> npm run build && npm start
- In HTML; use
<img src="http://image-optimizer-service/widthxheight/https://path-to-hosted-image.jpg" >
- HTTP request:
$> curl --request GET -sL \
--url 'http://image-optimizer-service/widthxheight/https://path-to-hosted-image.jpg' \
--output './path/to/file'
- NodeJS API-first microservice; created using personal template repository
- Health check endpoints
- CI checks for build
- Happy scenario image fetching and resizing API using Sharp
- Dockerfile
- Added security layer (with URL tokens and/or hashing)
- Usage patterns: (e.g with CDN, with caching layer and proxy-server, serverless approach)
- Telemetry support
- Logging Middleware
- API versioning
- Deployment descriptors
- Continuous Deployments support
TBD
This NodeJS implementation is far from done. It's inspired by years of working and tinkering with other solutions such as: