Image API Service. Built with NodeJS, Express, and Docker. Connects to the MongoDB Image Database.
⚠️ Heroku Deployment may be depreciated
curl https://llama-as-a-service-images.herokuapp.com/random
{
"message": "https://images.theconversation.com/files/337593/original/file-20200526-106811-ql6d51.jpg?ixlib=rb-1.1.0&q=45&auto=format&w=1200&h=900.0&fit=crop"
}
$ git clone https://github.com/llama-as-a-service/images-service.git
$ cd images-service
$ cp .env.sample .env
$ docker-compose up -d
# access on localhost:3000
$ docker-compose exec images_service yarn run test
# docker pull ghcr.io/OWNER/IMAGE_NAME
$ docker pull ghcr.io/llama-as-a-service/images-service:0.1.0
URL | /random |
---|---|
Method | GET |
Status | 200 OK |
Authentication | None |
Defualt = 1 Max = 25
?count=9
{
"message": [
"https://cdn.britannica.com/41/1/Alpaca.jpg?w=400&h=300&c=crop",
"https://images.pexels.com/photos/3396661/pexe61.jpg&fm=jpg",
"https://www.openaccess.org/wp-content/scaled.jpg",
...
],
}
URL | /upload |
---|---|
Method | POST |
Status | 201 CREATED |
Authentication | Admin |
{
"url": "https://cdn.britannica.com/41/1/Alpaca.jpg?w=400&h=300&c=crop",
}
{
"message": "Successfully upload image!",
}
$ yarn install
$ yarn run start # yarn run dev