Fortune.js 介绍
Fortune.js是 一个 超媒体 API 原型框架,实现 jsON API 规范。fortune 具有 一个 模块化的持久层,里面 包括 了 NeDB (内联),MongoDB, MysqL ,Postgres 和 sql ite 的适配器。
Fortune 实现了所有 jsON API 的规范,还有一些其他的特性:
使用简单, Fortune 提供免费的路线控制和 数据库 交互,不需要 用户 制作管道。
关联和双向关系的映射,不需要 用户 管理资源之 间的 关联关系。
在编辑前或者阅览之后, 自动 变换资源,实现特定的应用逻辑。
安装
npm install fortune --save
使用
const fortune = require('fortune') // Works in web bro wsers,too.
const store = fortune({
user: {
name: String,
// Following and followers are inversely related (many-to-many).
following: [ Array('user'),'followers' ],
followers: [ Array('user'),'following' ],
// Many-to-one relationship of user posts to post author.
posts: [ Array('post'),'author' ]
},
post: {
message: String,
// One-to-many relationship of post author to user posts.
author: [ 'user','posts' ]
}
})
网站地址 : http://fortune.js.org
GitHub: https://github.com/fortunejs/fortune
网站描述: 一个 超媒体 API 原型框架
Fortune.js官方网站
官方网站: http://fortune.js.org
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。