One method API preview.
Written in C# (ASP.NET Core WebAPI).
- .NET Core SDK
-
Download/clone repository.
-
Compile solution and run project.
cd ImagePreviewAPI && dotnet run --configuration Release
-
Go to localhost:5000.
- Docker Desktop (or Docker Toolbox).
If you use Docker Toolbox, you need to setup virtual machine.
-
Download/clone repository.
-
Build and run with:
docker-compose up
-
Go to localhost.
If you use Docker Toolbox, you need go to
http://ip-addr/
, whereip-addr
is ip-address of virtual machine.
Don't be scared, server should return 404 HTTP status code, if it runned.
This service has only one method.
POST /api/image/upload
Upload image/images by links.
Content-Type: application/json
Another mime-types doesn't supported.
- imagesUrls Required
Array of strings (URLs to images). Min count of array elements: 1
{
"imagesUrls": [
"first link",
"second link"
]
}
Content-Type: application/json
Another mime-types doesn't supported.
- uploaded
Object. Key is link. Value is object with original
and preview
properties.
original
String. Link to uploaded original image.
preview
String. Link to uploaded 100px x 100px image.
- failed
Array of strings (links, which images doesn't uploaded)
{
"uploaded": {
"first link": {
"original": "{link_to_image}",
"preview": "{link_to_image}"
},
"third link": {
"original": "{link_to_image}",
"preview": "{link_to_image}"
},
"fifth link": {
"original": "{link_to_image}",
"preview": "{link_to_image}"
}
},
"failed": [
"second link",
"fourth link"
]
}