Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Latest commit

 

History

History
37 lines (26 loc) · 1.05 KB

README.md

File metadata and controls

37 lines (26 loc) · 1.05 KB

image-service

Service to accept data url images and save them to images locally. Images can then be retrieved from service.

Setup

Clone repo locally using git clone https://github.com/MAHRIO/image-service.git or download zip from here

Use terminal and navigate to image-service/ folder, then install module dependencies using npm i

After dependencies, run node index. Go to https://127.0.0.1:3010 to take a picture and upload.

API

Upload image as data using following endpoint

https://127.0.0.1:3010/upload accepting application/json content-type with the following payload:

{
    file: 'data:image/png;base64, ... ',
    filename: 'filename-desired-with-extension.png',
    dataURL: true
}

The response

{
    filename: 'filename-desired-with-extension.png`
}

After a file has been saved you can preview it from the server using:

https://127.0.0.1:3010/images/filename-desired-with-extension.png

Other

See public/uploads/postman.png for alternative method to upload pictures.