超媒体 API 原型框架 Fortune.js

码农软件 · 软件分类 · JSON/BSON开发包 · 2019-03-31 19:28:45

软件介绍

fortune 是一个超媒体 API 原型框架,实现 JSON API 规范。fortune 具有一个模块化的持久层,里面包括了 NeDB (内联), MongoDB, MySQL, PostgresSQLite 的适配器,可以查看 引导手册 了解如何使用。

Fortune 实现了所有 JSON API 的规范,还有一些其他的特性:

  • 使用简单, Fortune 提供免费的路线控制和数据库交互,不需要用户制作管道。

  • 关联和双向关系的映射,不需要用户管理资源之间的关联关系。

  • 在编辑前或者阅览之后,自动变换资源,实现特定的应用逻辑

fortune 没有相关的授权和身份验证,你可以在你的应用中实现,可以查看样板:keystore.js

npm 安装: 

$ npm install fortune

示例代码:

import fortune from 'fortune'
import http from 'http'

const store = fortune.create()

// The `net.http` function returns a listener function which does content
// negotiation, parses headers, and maps the response to an HTTP response.
const server = http.createServer(fortune.net.http(store))

store.defineType('user', {
  name: { type: String },

  // Following and followers are inversely related (many-to-many).
  following: { link: 'user', inverse: 'followers', isArray: true },
  followers: { link: 'user', inverse: 'following', isArray: true },

  // Many-to-one relationship of user posts to post author.
  posts: { link: 'post', inverse: 'author', isArray: true }
})

store.defineType('post', {
  message: { type: String },

  // One-to-many relationship of post author to user posts.
  author: { link: 'user', inverse: 'posts' }
})

store.connect().then(() => server.listen(1337))

本文地址:https://codercto.com/soft/d/2577.html

智能优化方法

智能优化方法

汪定伟 / 2007-4 / 37.10元

《智能优化方法》主要介绍近年来产生发展的多种智能优化算法。包括为人熟知的遗传算法、禁忌搜索算法、模拟退火算法和蚁群优化算法;近年来已成为研究热点的粒子群优化算法;还有尚待普及的捕食搜索算法和动态环境下的进化计算。书中讨论这些算法的产生和发展、算法的基本思想和理论、基本构成、计算步骤和主要的变形以及数值例子和实际应用。为了方便读者学习,各章之后还附有精选的习题、思考题及相关的参考文献。 本教材......一起来看看 《智能优化方法》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具