Module: api/gallery-image

Methods

(async, inner) deleteGalleryImage(request, response)

Deletes specified gallery image

Parameters:
Name Type Description
request Object
Properties
Name Type Description
query.target string

ID to specify gallery image entry

response Object
Source:
Returns:

Result is logged into console

Example
$ curl -X DELETE \
      http://localhost:3001/api/gallery-image?target=1
// Deletes gallery image with ID of 1

(async, inner) getGalleryImage(request, response) → {JSON}

Get a gallery image information

Parameters:
Name Type Description
request Object
Properties
Name Type Description
query.target number

ID to specify gallery image entry

response Object
Source:
Returns:

JSON that contains information about gallery image

Type
JSON
Example
$ curl -X GET http://localhost:3001/api/gallery-image?target=1
// gets gallery image information with ID of 1

(async, inner) getGalleryImageList(request, response) → {string}

Gets list of gallery image entries in HTML table body tr+td

Parameters:
Name Type Description
request Object
response Object
Source:
Returns:

HTML table body tr+td

Type
string
Example
$ curl -X GET http://localhost:3001/api/gallery-image/list
// <tr>
//     <td>1</td>
//     <td>/image/test.png</td>
//     ...
// </tr>
// ...

(async, inner) getGalleryImageListUnwrapped(request, response) → {string}

Gets list of gallery image entries in Unformatted JSON string

Parameters:
Name Type Description
request Object
response Object
Source:
Returns:

Unformatted JSON string that contains gallery image entries

Type
string
Example
$ curl -X GET \
      http://localhost:3001/api/gallery-image/list-unwrapped
// gets raw JSON containing gallery image entries

(async, inner) postGalleryImage(request, response)

Posts gallery image

Parameters:
Name Type Description
request Object
Properties
Name Type Description
body.imagePath string

URL path to image

body.caption string

Caption of image

response Object
Source:
Returns:

Result is logged into console

Example
$ curl -X POST \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      --data-raw 'imagePath=/images/launch.png&caption=Launch of our new rocket' \
      http://localhost:3001/api/gallery-image/
// Posts gallery image with given information

(async, inner) putGalleryImage(request, response)

Updates gallery image

Parameters:
Name Type Description
request Object
Properties
Name Type Description
body.target number

ID to specify gallery image entry

body.imagePath string

URL path to image

body.caption string

Caption of image

response Object
Source:
Returns:

Result is logged into console

Example
$ curl -X PUT \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      --data-raw 'imagePath=/images/launch.png&caption=Launch of our new rocket' \
      http://localhost:3001/api/gallery-image/
// Updates gallery image with given information