Front end micro service solution 3 – engineering design pattern

Time:2021-4-21

Public entry file

The project uses the same public portal, all modules reuse the portal, and point to different modules according to different projects.

Front end micro service solution 3 - engineering design pattern

Component communication

All micro module resources and framework resources in the project can communicate with each other, refer to each other and access each other. There is no barrier between micro modules in the development version. To ensure the high availability of code components, all components can cross business communication, cross business use.

Resources include: business components, static resources (CSS, pictures, audio and video files, etc.), JS tools, etc

Front end micro service solution 3 - engineering design pattern

Sub module startup

In order to ensure that the project teams can run independently and develop independently. Although it is the same entry when starting the project, it can start the functions of the respective micro modules. It can start all or only one without interference.

Start Engineering OrderWhen starting, it is started by normal start command + micro module name. For example:npm run dev:project1The command startsproject1Micro module. When it starts, the browser will automatically open the page, which will be discussed in detail later.

Front end micro service solution 3 - engineering design pattern

Package by module

Each module can be packaged and launched independently without affecting each other to ensure high availability. The structure of the packaged resource directory is as follows:

Project packaging resources
The first micro module package resource
│   │   ├── static
│   │   ├── index.html
In this paper, we present a method to solve this problem
The second micro module packages resources
│   │   ├── static
│   │   ├── index.html
In this paper, we present a method to solve this problem
│   └── 。。。

Packaging Engineering OrderWhen packaging, it is started by normal packaging Command + micro module name. For example:npm run build:project1The command is packaged asproject1Micro module. After packaging, the corresponding micro module folder is produced in the dist folder.

Front end micro service solution 3 - engineering design pattern

Package structure

Front end micro service solution 3 - engineering design pattern

This work adoptsCC agreementReprint must indicate the author and the link of this article

Recommended Today

Review of SQL Sever basic command

catalogue preface Installation of virtual machine Commands and operations Basic command syntax Case sensitive SQL keyword and function name Column and Index Names alias Too long to see? Space Database connection Connection of SSMS Connection of command line Database operation establish delete constraint integrity constraint Common constraints NOT NULL UNIQUE PRIMARY KEY FOREIGN KEY DEFAULT […]