upload image & get image service.
The uploaded image shrinks like catching Small light.
Consits of The following four components
- datastore
- webserver
- worker
- workqueue
- datastore
[datastore]
- redis
[webserver]
- node.js
- express
- redis
- amqp
- jest
- supertest
- multer
[worker]
- node.js
- redis
- amqp
- jimp
[workqueue]
- Rabbitmq
[datastore]
- use docker volume
- create network
docker network create --driver bridge doranetdocker network ls
- create volume
docker volume create --name filestoragedocker volume ls
- start service
- webserver
cd /webserverdocker-compose up
- workqueue
cd /workqueuedocker-compose up- create queue
- Please enter in your browser http://localhost:15672/
- ID/PASS guest/guest
- craete queue named
task_queue
- Please enter in your browser http://localhost:15672/
- worker
cd /workerdocker-compose up
- datastore
cd /datastoredocker-compose up
- webserver
- curl -X POST -F img=@[imagename] http://localhost:3000/image
- e.g:
curl -X POST -F img=@/tmp/doraemon/download.jpg http://localhost:3000/image
- e.g:
GET http://localhost:3000/image/[imageID]
e.g: Please enter in your browser http://localhost:3000/image/15647575116480.07167631302903654
npm test [fileName]- eg:
npm test app.test.js
- eg:
- way to create random_id
- image name when save image
- common use of components redis client
- retry worker
- add test mock
- add asnapshot test
- think of downning queue
- think of downning redis
- add test
- multer test
- get
- target id image file is none
- target id image file exist
- redis transaction
- add test
- Failure to receive id
- when target id file is none
- redis transaction
- way to convert image
- https://32imuf.com/docker/use-volumes-with-docker-compose/
- https://docs.docker.com/storage/volumes/#share-data-among-machines
- gcloud components install pubsub-emulator
- http://www.albertgao.xyz/2017/05/24/how-to-test-expressjs-with-jest-and-supertest/
- http://luoxia.me/yohe_site/2017/09/7/RabbitMQ/index.html
- 30 ~ 35h