tappin logo - word 'tappin' with a period surrounded by black border
  1. Introduction
    1. Welcome
    2. Basics
    3. Factory
    4. Philosophy
  2. Reflection
    1. Overview
    2. Dynamic loading
  3. HTTP
    1. Overview
    2. Server
    3. Middlewares

Factory

What is a factory?

A factory is an initializer for your application.

Lets go back to our favorite analogy - Lego set!

If you are building a Lego set, congratulations, you are a factory! Tappin's factory does exactly the same - it collects all modules and services, connectes them and starts it.

Using factory

Factory is created using createFactory function. It is located in core package.

const appModule = createModule(...);

const factory = createFactory(appModule); // factory accepts ONE root module
await factory.start(); // starts entire application and calls onStart hooks

Factory also exports some functions you may find useful.