Ġabra is an open lexicon for Maltese.
This repository contains the source code for the Ġabra API at http://mlrs.research.um.edu.mt/resources/gabra-api/
- You need Node.js. After cloning the repo run
npm installto install Node packages locally. - You will need a file
server-config.jscontaining the relevant details for your host. Start by copyingserver-config.sample.js.
- You will need a MongoDB installation. See http://mlrs.research.um.edu.mt/resources/gabra-api/download for data dumps you can use to get started. TODO: non-data tables
Use PM2: pm2 start processes.json or just run the file start.sh.
You must set the environment variable NODE_ENV to production if relevant.
The tests use:
- mocha framework (
describe,it, etc.) - supertest for high-level HTTP testing (
requestetc.) - should.js assertion library (
x.should.equal(y)etc.)
Run all tests with npm test.
Run an individual testsuite with npx mocha --exit test/schema.js or use the --grep flag.
To stop on first failure, use --bail
Set dbUrl in server-config.js to ...gabra-test (or something else)
node scripts/node/populate.js test/data/*.json
node scripts/node/resolve-lexeme-ids.js
node scripts/node/create-indexes.js
(cd scripts/node && ./run.js update-glosses-collection.js)masterbranch is used for development.productionbranch is kept in sync with live version on MLRS.
Pushing to production will trigger a deploy via GitHub actions.
Assuming production can be fast-forwarded:
git push . master:production
git push origin production