2021-09-07 14:33:20 +02:00
2021-09-07 14:33:20 +02:00
2019-09-03 14:03:57 +02:00
2019-09-03 14:03:57 +02:00
2019-09-03 14:03:57 +02:00
2021-09-07 13:02:44 +02:00
2019-09-03 14:03:57 +02:00
2021-09-07 13:02:44 +02:00
2019-09-03 14:03:57 +02:00
2021-09-07 13:02:44 +02:00
2021-09-07 14:33:20 +02:00
2019-09-03 14:03:57 +02:00
2019-09-03 14:03:57 +02:00

minimal-connector

Prerequisites

How to get started

To install all required npm packages:

npm install

To prepare the script to be executed, run:

npm run build

To start the plugin, you need to execute the code in "CLI" script:

node lib/cli.js -b <backendURL> -n <pluginName> -r <routeName> -u <URL> -p <port>

With fallback values being:
backendURL = http://localhost:3000 , pluginName = minimal-plugin , 
routeName = minimalplugin , URL = http://localhost, port = 4000

Using environment variables you can set backendURL via STAPPS_BACKEND, URL via PLUGIN_URL and port via PLUGIN_URL.

Creating your own plugin

  • Modify the default values in cli.ts to your needs:
    • update the name
    • update the port
    • update the route
    • update your request and response names (You need these in a bit)
  • Rename the minimal-plugin.ts and the MinimalPlugin class to a more suitable name and adjust the imports in other files
  • Delete the sum function in minimal-plugin.ts and write your own logic inside the onRouteInvoke function
  • Define the layout of your http requests and responses inside the /plugin/protocol folder. The names of the interfaces need to be the same as the request and response names you defined in the cli.ts

Code structure

Folder src contains:

Description
Monorepo that contains all projects for the Open StApps project.
Readme 56 MiB
Languages
TypeScript 85.8%
HTML 7.5%
SCSS 4%
JavaScript 1.6%
Dockerfile 0.4%
Other 0.5%