iimT
V2EX  ›  Node.js

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

  •  
  •   iimT · May 14, 2018 · 5169 views
    This topic created in 2946 days ago, the information mentioned may be changed or developed.

    用 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

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

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   831 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 21:04 · PVG 05:04 · LAX 14:04 · JFK 17:04
    ♥ Do have faith in what you're doing.