mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-13 17:56:20 +00:00
b094885b0574260a325a56f88f759144c1bdcc4c
@openstapps/minimal-connector
Prerequisites:
-
node(version 10+) andnpminstalled -
a backend, which is running locally (on http://localhost:3000) --- for testing purposes, it is advisable to use
minimal-deploymentproject
How to get started
To install all needed npm packages:
npm install
To prepare the script to be executed, run:
npm run build
To execute the code in "CLI" script (basically to execute the connector):
node lib/cli.js
To run some sample tests, use:
npm test
The npm scripts are defined in package.json file.
Code structure
File src/main.ts contains:
MinimalConnectoras class with samplegetItems()method, which simulates fetching of items from a resource and validator property which is useful for validating items against StAppsCore- sample indexing methods:
parse,bulk,indexandfinish
File src/cli.ts contains:
- instantiation of a client
- calls to asynchronous indexing methods using
automethod ofasynclibrary
File test/MinimalConnector.spec.ts contains sample test suite using mocha and chai.
Description
Languages
TypeScript
85.8%
HTML
7.5%
SCSS
4%
JavaScript
1.6%
Dockerfile
0.4%
Other
0.5%