This module defines the WebfocusApp class to help in the creation of NodeJS servers using express and Pug.
The main idea of this module is to enable the creation of independet components with the WebfocusComponent
class (see @webfocus/component) and the creation of applications with WebfocusApp
class using said components.
Specifically, the WebfocusApp
creates an express server internaly.
Allows you to register specific components to the server.
To use it const WebfocusApp = require('@webfocus/app');
.
More information of the WebfocusApp.
On your current project:
npm install @webfocus/app
Or use the initializer:
npm init @webfocus/app
The later will create a template WebfocusApp (the package.json
and index.js
files)
let WebfocusApp = require('@webfocus/app');
let webfocusApp = new WebfocusApp(options);
webfocusApp.registerComponent(webfocusComponentInstance1);
webfocusApp.registerComponent(webfocusComponentInstance2);
// ...
webfocusApp.registerComponent(webfocusComponentInstanceN);
webfocusApp.start();
In the repository we do end-to-end tests with cypress tests on an sample implementation.