Skip to main content

Worker-Javascript

The Worker-Java executes the provided Javascript code at the remote worker. More information about the worker at: https://github.com/apioo/fusio-worker-javascript

Example

module.exports = async function(request, context, connector, response, dispatcher, logger) {
const connection = await connector.getConnection('app');
const [entries, fields] = await connection.query('SELECT name, description FROM app_product_0');

response.build(200, {}, {
foo: 'bar',
entries: entries
});
};

Types

This table contains an overview which connection types are implemented and which implementation is used:

TypeImplementation
Fusio.Adapter.Sql.Connection.Sqlmysql2 / pg
Fusio.Adapter.Sql.Connection.SqlAdvancedmysql2 / pg
Fusio.Adapter.Http.Connection.Httpaxios
Fusio.Adapter.Mongodb.Connection.MongoDBmongoose
Fusio.Adapter.Elasticsearch.Connection.Elasticsearch@elastic/elasticsearch

Video