Skip to content
Tim Fuchs edited this page Feb 24, 2023 · 5 revisions

Getting Started

Engine

Installation

To install the fibre_ engine, run npm install --save @fibrejs/engine

Usage

To instantiate the engine, only a config provider is required. Your configuration provider must extend the abstract ConfigProvider class:

import Engine, { ConfigProvider } from '@fibrejs/engine';

class CustomConfigProvider extends ConfigProvider { }

const engine = new Engine({ 
  configProvider: new CustomConfigProvider();
});

For more information about custom ConfigProviders, see here
To instantiate the engine with one or more custom nodes, read Creating Custom Nodes

Editor

Installation

To install the fibre_ graphical editor, run npm install --save @fibrejs/editor

Usage

The fibre_ editor does not include a webserver. Instead, it exports an Express.js Middleware which can be configured as follows:

import express from 'express';

import Engine from '@fibrejs/engine';
import createMiddleware from '@fibrejs/editor';

const app = express();

const engine = new Engine();

app.use(
  createMiddleware({
    engine,
    name: 'fibre_', // Required: Name of your application, displayed in the page title and sidebar
    nameShort: 'f_', // Required: Short version (1-3 characters) of your application name
    apiPath: '/api', // Optional, defaults to '/api': The editor will serve it's API on this subpath
    authenticationProvider: undefined, // Optional, see below for more information 
  })
);

If you want to register the editor on a basepath other than the root path, you can use app.use('/some/path', createMiddleware()) to do that.
For more information about custom authentication providers, see here

Clone this wiki locally