hpyer-server
TypeScript icon, indicating that this package has built-in type declarations

2.2.4 • Public • Published

hpyer-server 2.x

本项目是本人结合实际项目中的使用情况,提炼出来的 Node.js 的服务端框架。框架采用 Module-MVC 模式,基于 koa2 框架开发,并叠加了其他功能。

2.x 用 Typescript 重写,对 vscode 更加友好

功能特点

  • 基于 Koa2 框架
  • 关系数据库操作(暂支持:MySql)
  • 缓存操作(暂支持:文件、Redis)
  • 视图模版(暂支持:nunjucks)

使用方式

// 引入 hpyer-server 的 HpyerApplication 类
const { HpyerApplication } = require('hpyer-server');

// 相关配置项
let cfg = {
  port: 1234,
  ...
};

// 实例化应用
let Hpyer = new HpyerApplication;

// 启动服务
await Hpyer.start(cfg);

配置项

详见:DefaultConfig.js

DEMO

详见:test

Readme

Keywords

Package Sidebar

Install

npm i hpyer-server

Weekly Downloads

1

Version

2.2.4

License

MIT

Unpacked Size

154 kB

Total Files

36

Last publish

Collaborators

  • hpyer