mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-17 03:36:22 +00:00
3bf69988f4bc02115cb9f083615ab83535b707f5
@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%