V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iimT
V2EX  ›  Node.js

一个基于 restify 的二次封装的 Nodejs RESTful API 框架

  •  
  •   iimT · 2018-05-14 14:32:37 +08:00 · 4212 次点击
    这是一个创建于 2167 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用 restify 的时候封装的一个小东西,感觉也不算框架,但是比直接用 restify 开发方便很多。

    在新建一个 API 服务的时候,只需要在文件中定义好 API 的结构,如

    Test: {
        hello: {
          params: ["name", "msg"],
          methods: ["post", "get"],
        },
      },
    

    然后在 Test.js 中写好 hello 方法,就能访问 /Test/hello 了

    Github 地址: https://github.com/tfh93121/node-mt-api

    新人第一次发帖,欢迎大佬提意见。

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2970 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 03:11 · PVG 11:11 · LAX 20:11 · JFK 23:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.