New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

restful-started

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restful-started

typescript restful started

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

restful-started

简化使用ts-express-restful 模块时的各种配置,一句启动服务器

    require("restful-started")
        .configRoute({})
        .configDb({url: "postgres://"})
        .start({});

约定

  • 如果调用configRoute 时未配置参数,将扫描 程序运行路径下所有文件去查找 ts 注解
  • 如果未配置 model path 将查找程序运行路径下 model文件夹去找 model 生成数据库
  • 可用注解参考 ts-express-restful 模块
  • 具体使用参考 example文件

配置

  • configRoute 可用配置
export interface IRouteOptions { 
    scannerDir?: string;
    urlPrefix?: string;
}
  • configDb 可用配置
export interface IDatabaseOptions { 
    modelDir?: string;
    force?: boolean;
    url?: string;
}
  • 启动start 可用参数
export interface IServerOptions { 
    listen?: PORT;
}

Keywords

typescript

FAQs

Package last updated on 18 Jul 2019

Related posts