在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:holidayextras/jsonapi-server开源软件地址:https://github.com/holidayextras/jsonapi-server开源编程语言:JavaScript 100.0%开源软件介绍:jsonapi-serverA config driven NodeJS framework implementing Motivation / Justification / RationaleThis framework solves the challenges of json:api and GraphQL without coupling us to any one ORM solution. Every other module out there is either tightly coupled to a database implementation, tracking an old version of the json:api spec, or is merely a helper library for a small feature. If you're building an API and your use case only involves reading and writing to a data store... well count yourself lucky. For everyone else, this framework provides the flexibility to provide a complex API without being confined to any one technology. A config driven approach to building an API enables:
Ultimately, the only things you as a user of this framework need to care about are:
We've created
We've also written a library to ease the consumption of a json:api compliant service, if GraphQL isn't your thing:
Full documentation
The tl;drYou can have a complete json:api server providing a var jsonApi = require("jsonapi-server");
jsonApi.setConfig({
port: 16006,
graphiql: true
});
jsonApi.define({
resource: "photos",
handlers: new jsonApi.MemoryHandler(),
attributes: {
title: jsonApi.Joi.string(),
url: jsonApi.Joi.string().uri(),
height: jsonApi.Joi.number().min(1).max(10000).precision(0),
width: jsonApi.Joi.number().min(1).max(10000).precision(0)
}
});
jsonApi.start(); Your new API will be alive at Show me a full example!Fire up an example
then browse to the JSON:API endpoints:
or, for GraphQL:
the example implementation can be found here |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论