@@ -14,9 +14,9 @@ npm i microframework
1414Second, create a simple "module" named ` expressModule ` :
1515
1616``` typescript
17- import {MicroframeworkBootstrapSettings } from " microframework" ;
17+ import {MicroframeworkSettings } from " microframework" ;
1818
19- export function expressModule(settings : MicroframeworkBootstrapSettings ) {
19+ export function expressModule(settings : MicroframeworkSettings ) {
2020
2121 // create express app
2222 const app = express ();
@@ -83,9 +83,9 @@ For such purpose you can store the data in `settings` object passed to each modu
8383and use stored data across all other modules. For example:
8484
8585``` typescript
86- import {MicroframeworkBootstrapSettings } from " microframework" ;
86+ import {MicroframeworkSettings } from " microframework" ;
8787
88- export function expressModule(settings : MicroframeworkBootstrapSettings ) {
88+ export function expressModule(settings : MicroframeworkSettings ) {
8989
9090 // create express app
9191 const app = express ();
@@ -104,9 +104,9 @@ export function expressModule(settings: MicroframeworkBootstrapSettings) {
104104And another modules can use data this way:
105105
106106``` typescript
107- import {MicroframeworkBootstrapSettings } from " microframework" ;
107+ import {MicroframeworkSettings } from " microframework" ;
108108
109- export function socketIoModule(settings : MicroframeworkBootstrapSettings ) {
109+ export function socketIoModule(settings : MicroframeworkSettings ) {
110110 const io = io ();
111111 io .useExpress (settings .getData (" express_app" ));
112112}
@@ -145,7 +145,7 @@ bootstrapMicroframework({
145145All modules which use resources should release them, for example:
146146
147147``` typescript
148- export async function typeormModule(settings : MicroframeworkBootstrapSettings ) {
148+ export async function typeormModule(settings : MicroframeworkSettings ) {
149149 const connection = await createConnection ({
150150 driver: {
151151 type: " mysql" ,
@@ -156,6 +156,6 @@ export async function typeormModule(settings: MicroframeworkBootstrapSettings) {
156156 }
157157 });
158158
159- settings .addShutdownHandler (() => connection .close ());
159+ settings .onShutdown (() => connection .close ());
160160}
161161```
0 commit comments