3.0.1 • Published 8 months ago

elmer-boot v3.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

elmer-boot

NodeJs服务端框架,基于typescript 5.6开发,使用最新版装饰器封装,默认基于Express 4.26

开发进度

  • 读取配置信息,合并根据运行环境配置信息
  • 基本路由监听,参数读取封装
  • 模块注入,完成AppRequest
  • 配置参数通过命令初始化模板
  • 数据库连接,Mysql
  • 请求参数校验,使用Json Schema方式定义
  • Session数据保存
  • 全局数据共享
  • 单个请求数据共享
  • Session数据共享
  • 文件上传保存
  • 跨域请求检查
  • 请求转发
  • 模拟消息队列处理
  • 并发请求处理
  • 新增注解给路由加注释,并生成文档
  • Json转Typescript类型

命令行参数

参数说明
APP_ENV运行环境
configPath配置文件路径

配置参数

Server:
  port: 8001
  host: 0.0.0.0
  publicKey: 5e7692707c144a33
  staticPath: "./stub"
  staticRoute: "/public"
  uploadPath: "./stub/res"
  tempPath: "./stub/temp"
  otherPath: "/Users/mnt/api"
Log:
  level: info
  savePath: "./logs"
Session:
  enabled: true
  timeout: 120000
Email:
  pop3: pop3.163.com,
  smtp: smtp.163.com
  user: elmer@163.com
  accessKey: 123456

装饰器

装饰器功能特殊说明
BootApplication装载启动类标识启动类,将在启动类装载运行所需配置信息
Config装载配置文件信息此装饰器必须在启动类使用
GetConfig获取配置信息获取系统配置信息,示例:@GetConfig("Server", "host")
AppService装载Service模块装载的类在一个application中只会初始化一次,并在服务停止时销毁
AppRequestRequest类模块一个请求初始化一次,在请求结束时销毁
AppModel模块注入类装饰器,注入模块系统自动初始化模块, 示例:@AppModel([ TestModel1, TestModel2 ]), 在constructor接收初始化对象,constructor(private model1: TestModel1, private model2: TestModel2)) {}
RequestMapping定义路由定义路由,示例 :@RequestMapping("/example", "GET")
Get定义Get路由Get路由,示例:@Get("/example")
Post定义POST路由Post路由,示例:@POST("/example")
GetParam获取请求参数此装饰器必须在定义路由装饰器之后使用, 详细用法参考:使用教程

扩展模块

  • Email, 发送邮件模块
3.0.1

8 months ago

3.0.0

8 months ago

2.0.10

10 months ago

2.0.9

1 year ago

2.0.8

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.2.12

4 years ago

1.2.13

4 years ago

1.2.11

4 years ago

1.2.9

4 years ago

1.2.10

4 years ago

1.2.8

4 years ago

1.2.0

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago