Skip to content

A simple Node application to store and retrieve IIIF manifests via REST API

License

Notifications You must be signed in to change notification settings

brittnylapierre/iiif-manifest-store

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iiif-manifest-store

A simple Node application to store and retrieve IIIF manifests via REST API. It can be used in conjunction with the IIIF Manifest Editor to store manifests remotely. Please note that this application currently does not support authentication so anybody can POST and GET manifests to the store. Use it behind a firewall and/or for testing purposes only.

How to set up the application

Prerequisites

Installation

  • Clone this repository: git clone [email protected]:textandbytes/iiif-manifest-store.git
  • Change into the project directory: cd iiif-manifest-store
  • Install Node v8.1.4 with nvm: nvm install v8.9.4
  • Install the required node modules into the project: npm install

How to run the application

API

Route HTTP Verb Description
/api/manifests GET Get all manifests
/api/manifests POST Create a manifest - returns manifest uri
/api/manifests/:manifestId GET Get manifest by id
/api/manifests/:manifestId PUT Update manifest with id
/api/manifests/:manifestId DELETE Delete manifest with id (currently not implemented)

Get a List of All Manifests

Request: GET /api/manifests

Example URL: http://localhost:3001/api/manifests

HTTP Status Code: 200 OK

Response:

{"manifests":
  [
    {"uri":"http://localhost:3001/api/manifests/6b3bf0a8-b8f6-452a-bcbf-f336ff335c93"},
    {"uri":"http://localhost:3001/api/manifests/db45e27f-edbf-446b-8794-eb9070c3647e"},
    {"uri":"http://localhost:3001/api/manifests/example-manifest"}
  ]
}

Create a Manifest

Request: POST /api/manifests

Example URL: http://localhost:3001/api/manifests

HTTP Status Code: 201 Created

Response:

{
    "uri": "http://localhost:3001/api/manifests/f20c81a0-be0f-4cc6-bf48-891429faad11"
}

Update a Manifest

Request: PUT /api/manifests/manifestId

Example URL: http://localhost:3001/api/manifests/example-manifest

HTTP Status Code: 200 OK

Response:

{
    "message": "Manifest successfully updated"
}

Get a Single Manifest

Request: GET /api/manifests/manifestId

Example URL: http://localhost:3001/api/manifests/example-manifest

HTTP Status Code: 200 OK

Response:

{
    {
        "@context": "http://iiif.io/api/presentation/2/context.json",
        "@id": "example-manifest",
        "@type": "sc:Manifest",
        "label": "Example Manifest",
        "metadata": [],
        "description": [
            {
                "@value": "Example Description",
                "@language": "en"
            }
        ],
        "license": "https://creativecommons.org/licenses/by/3.0/",
        "attribution": "Example Attribution",
        "sequences": [
            {
                "@id": "example-sequence",
                "@type": "sc:Sequence",
                "label": [
                    {
                        "@value": "Example Sequence Label",
                        "@language": "en"
                    }
                ],
                "canvases": []
            }
        ],
        "structures": []
    }
}

About

A simple Node application to store and retrieve IIIF manifests via REST API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%