NatLibFi / voyager-http-api

RESTful HTTP API for Voyager ILS
Apache License 2.0
0 stars 0 forks source link

Query database instead of using external API #8

Open natlibfi-arlehiko opened 6 years ago

natlibfi-arlehiko commented 6 years ago

Description

Currently retrieving records is done using voyager-record-fetch-cgi. This requires an external service. The current implementation of the service also has a bug which sometimes prevents the record from being updated (Although Batchcat DLL doesn't report an error but the record isn't updated).

Using a direct SQL connection to Voyager database removes the need to use an external service and allow the bug to be fixed in this codebase.

Specification

Configuration

Configuration file (fetchApi property is no longer needed)

{
  "port": 1337,
  "iniFile": "/foo/bar/voyager.ini",
  "externalUrl": "https://foo.bar/api",
  "db": {
    "connectString": "VGER",
    "username": "foo",
    "password": "bar"
  }
}

Environment variables