MVC style of API on top of Knora
When planning for a web or mobile app, the front-end standards are based on MVC/Rest API.
To ease the development of such interfaces for data that are hosted in Knora, KnoraMVC takes a model and makes the necessary calls to Knora in order to populate it.
This API server explores the data graph according to the data model, sends the subrequests to Knora, coordinates the results and sends back a comprehensive answer.
- requirements: node and npm
- clone from here
https://github.com/LaDHUL/KnoraMVC - install the node packages:
node install
- main config, as described in the node package config, you can have a look at
config/default.jasonand overwrite whatever value in seperate config file - to hook on a real server, cert files should be changed (see folder
/certsthat just hold self signed certs to be able to run the API as is) - the main work is to set the model ('M' in MVC)
-
requirements: this is an interface on top of Knora, so you need a Knora instance
-
run:
npm start
or in development mode, in the project directory:
./node_modules/.bin/nodemon ./bin/www
You might want to enable debug log on some of the code parts:
DEBUG=app,resources,knora ./node_modules/.bin/nodemon ./bin/www
There is a test set-up using jasmine, but it is for now dependant on test data stored in knora. It will be generalised.