kit-external-asset-proxy

1.5.0 • Public • Published

kit-external-asset-proxy

Installing

npm install

Configure .env file with appropriate keys for integrated services.

Using the API

The API only has one endpoint, the defulat /, so the string you write there is the "search-string" which is used to search the added services.

Searching

Searching for cats is done this way http://localhost:1221/search/cats

Queries

Limit

The query name for limit is l and is of type Number, which might look this way l=1

Pagination

The query name for pagination is p and is of type Number, which might look this way p=1

Service

You can choose to only make a search on a specific service with specifying the name of with the help of the service query. The query name for pagination is s and is of type String, which might look this way s=pixabay

A combined search with al the queries might look like this: http://localhost:1221/search/cat dog?l=1&p=1&s=pixabay

Example response

[
    {
    url: 'https://www.pexels.com/',
    name: 'Pexels',
    list: [{
            orginalName: "name.jpg",
            provider: "pexels",
            assetType: "image", //could also be video for some providers
            duration: 11, //This field is only included if assetType is video
            scaledImages: {
                kse: {
                    large: { //Used for displaying full size images
                        width: 0,
                        height: 0,
                        url: "https://url.url.url/name.jpg"
                    },
                    squareMedium: { //Used for displaying listing/preview sized images
                        width: 0,
                        height: 0,
                        url: "https://url.url.url/name.jpg"
                    }
                }
            },
            credit: {
                text: null,
                link: null,
                name: null
            },
            downloadUrl: '',
            detailsUrl: ''
        }],
    },
    {
        displayName: "Pixabay",
        url: 'https://pixabay.com/',
        list: []
    }
]

Services

Included services at this moment is

Readme

Keywords

none

Package Sidebar

Install

npm i kit-external-asset-proxy

Weekly Downloads

0

Version

1.5.0

License

ISC

Unpacked Size

41.9 kB

Total Files

43

Last publish

Collaborators

  • kitmedia