0.0.24 • Published 10 years ago

nodeajax v0.0.24

Weekly downloads
2
License
MIT
Repository
-
Last release
10 years ago

nodeajax

Web 开发数据模拟环境,提供前端模拟 View 层解决方案。

参照 jQuery 设计 API,使用 JavaScript 编写AJAX模拟数据 使用 handlebars 编写后端模板引擎,提高前后端开发效率

  • 模拟 AJAX
  • 模拟后端开发环境中的 JSON + 模板渲染 HTML
  • 模拟 RESTfull 接口

安装

npm install nodeajax

轻松模拟数据

创建 app.js 文件,并写入如下内容

$.doc('# 数据交互文档')

$.ajax('/ajax/').done({
    status: "success",
    msg: "成功加入会员"
})

$.ajax('/array/').done(
    [
        1,
        2,
        3,
        4
    ]
    )

$.ajax('/function/').done(function (req, res) {
    res.json(req.query)
})

在命令行输入(推荐使用 nodemon

cd [切换至 app.js 所在的目录]
node app

成功运行后将根据代码自动生成的控制台

更多示例

nodeajax-examples

0.0.24

10 years ago

0.0.23

10 years ago

0.0.20

10 years ago

0.0.19

10 years ago

0.0.18

10 years ago

0.0.16

10 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

11 years ago