Skip to content

MLRS/gabra-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

27490cf · Apr 23, 2021
Jul 5, 2020
Jun 9, 2016
Apr 14, 2020
Oct 27, 2020
Jul 4, 2020
Mar 16, 2020
Jul 4, 2020
Jul 4, 2020
Dec 18, 2019
Nov 29, 2019
Feb 2, 2019
Dec 31, 2019
Jun 9, 2016
Jul 4, 2020
Apr 1, 2020
Apr 15, 2020
Jan 27, 2020
Apr 23, 2021
Jul 4, 2020
Jun 9, 2016
Mar 19, 2020
Jan 2, 2020
Dec 29, 2019

Repository files navigation

API for Ġabra

Ġ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/

Installation

Web app

  • You need Node.js. After cloning the repo run npm install to install Node packages locally.
  • You will need a file server-config.js containing the relevant details for your host. Start by copying server-config.sample.js.

Database

Running

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.

Tests

The tests use:

  1. mocha framework (describe, it, etc.)
  2. supertest for high-level HTTP testing (request etc.)
  3. 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

Using test data

  1. Set DB URL 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)


## Repository

- `master` branch is used for development.
- `production` branch is kept in sync with live version on MLRS.

**Deploying**

Pushing to production will trigger a deploy via GitHub actions.

Assuming production can be fast-forwarded:

git push . master:production git push origin production