This API allows users to view, create, update and delete library donations.
In the context of this API, a donation is a monetary donation to the library. The donation results in the library adding a book plate to a book in its collection.
Each donation record includes information about:
- donor
- who should be notified of the donation
- recipient
- amount of donation
- date of donation
- subject areas (to help choose the book)
- book (which contains the book plate dedicated to the recipient)
Check out our contributing guidelines for ways to offer feedback and contribute.
All other content is released under CC-BY-4.0.
- Go into
living-library
folder (i.e. root folder of app) - Run
npm install
- If it doesn't work the first time, delete the
node_modules
folder and rerunnpm install
- Have mysql 5.4 - 5.7
- Add
.env
file to root folder of app (you can copy.env-example
) - Define the
API_ROUTE
andAPI_KEY
variables in your.env
file - Create a mysql database named
livinglibrary
(or whatever value you give to theDB_NAME
variable in your.env
file) - Define the variables from the
# Database
section of your.env
file (see.env-example
) - Import
livinglibrary.sql
(for schema only, no content) orlivinglibrary_with_example_content.sql
(for schema & example content) - Make sure the variables from the
# Tables from new database schema
section of your.env
file (see.env-example
) match your mysql database
- Define the
SSL_KEY
andSSL_CERTIFICATE
variables in your.env
file - Run
node living-library.js
- Go to
https://localhost:8000/API_ROUTE?api_key=API_KEY
(i.e.HOST + API_ROUTE + "?api_key=" + API_KEY
), whereHOST
,API_ROUTE
, andAPI_KEY
are defined in your.env
file
- In your
.env
file, make sure theHOST
,API_URL
, andCORS_ALLOWED_ORIGIN
variables have values that begin withhttp
rather thanhttps
- In
config/express.js
, changeconst HTTPS = require('https')
toconst HTTP = require('http')
. Also, changetoSERVER = HTTPS.createServer({ key: FS.readFileSync(CONFIG.sslKey), cert: FS.readFileSync(CONFIG.sslCertificate) }, APP);
SERVER = HTTP.createServer(APP);
- Run
node living-library.js
- Go to
http://localhost:8000/API_ROUTE?api_key=API_KEY
(i.e.HOST + API_ROUTE + "?api_key=" + API_KEY
), whereHOST
,API_ROUTE
, andAPI_KEY
are defined in your.env
file
Here is an example of code that integrates with this API.
In particular, see get.js
and postPutDelete.js
from above link.
@scottsalvaggio
@freyesdulib, @jrynhart, @kimpham54
Ways to get in touch:
- Contact the Digital Infrastructure & Technology Coordinator at University of Denver, Library Technology Services
- Create an issue in this repository