1.1.5 • Published 2 years ago

@hoth/molecule v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@hoth/molecule

Demo

controller.ts

import {FastifyLoggerInstance} from 'fastify';
import {Controller as IController} from '@baidu/molecule';

export class Controller implements IController {
    root: string;
    logger: FastifyLoggerInstance;

    constructor(options: Option) {
        this.logger = options.logger;
        this.root = options.root;
    }

    render(data: Data) {
        return `appname is ${data.appname}, route name is ${data.name}, title is ${data.title}`;
    }
}

node server

import {molecule} from '@hoth/molecule';

let ret = await molecule(ctrlPath, data, {
    root: '/dist',
    appName: 'appname',
    name: 'route name',
    logger: fastify.log,
});
1.1.5

2 years ago

1.1.1

3 years ago

1.0.2

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

1.1.4

3 years ago

1.1.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago