网站首页 > 开源技术 正文
在开发过程中可能会遇到接口数据调试,服务端开发者可轻松搭建个本地服务器,例如:tomcat、apache、python、nodejs等都可轻松调起本地服务,如果你是个前端,没有后端技术,你可以用my-json-server.typicode.com所提供的方式调试。
- 在github.com上创建一个仓库,必须是public
- 在仓库中添加文件db.json
{
"posts": [
{
"id": 1,
"title": "hello"
},
{
"id": 2,
"title": "world"
}
],
"profile": {
"name": "typicode"
},
"gets": [
{
"id": 1,
"name": "张良"
},
{
"id": 2,
"name": "韩信"
}
]
}
- 使用https://my-json-server.typicode.com/<你的用户名>/<你的仓库名> 可访问你的测试服务首页
- 上面创建了仓库jsonapi,假设你的用户名是"test1",那么访问https://my-json-server.typicode.com/test1/jsonapi,可看到有四个可访问的接口:“posts、profile、gets、db”,如图:
访问posts接口 https://my-json-server.typicode.com/test1/jsonapi/posts
[
{
"id": 1,
"title": "hello"
},
{
"id": 2,
"title": "world"
}
]
访问posts/1接口 https://my-json-server.typicode.com/test1/jsonapi/posts/1
{
"id": 1,
"title": "hello"
}
猜你喜欢
- 2024-09-16 比较一下XML, JSON和YAML(xml与json区别)
- 2024-09-16 JSON的概念及应用场景举例(json的概念及应用场景举例分析)
- 2024-09-16 Java实现在线SQL编程(完整版)(java代码中怎样写sql语句)
- 2024-09-16 RESTful API (Application Programming Interface)
- 2024-09-16 API低代码开发平台实践(低代码开发工具)
- 2024-09-16 JSON 格式的接口测试流程【Eolink Apikit】
- 2024-09-16 推荐腾讯开源的零代码、全功能、强安全API架构
- 2024-09-16 下个十年高性能 JSON 库来了:fastjson2!
- 2024-09-16 高并发之API接口,分布式,防刷限流,如何做?
- 2024-09-16 可以让你零代码快速开发REST API的几个开源项目
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- jdk (81)
- putty (66)
- rufus (78)
- 内网穿透 (89)
- okhttp (70)
- powertoys (74)
- windowsterminal (81)
- netcat (65)
- ghostscript (65)
- veracrypt (65)
- asp.netcore (70)
- wrk (67)
- aspose.words (80)
- itk (80)
- ajaxfileupload.js (66)
- sqlhelper (67)
- express.js (67)
- phpmailer (67)
- xjar (70)
- redisclient (78)
- wakeonlan (66)
- tinygo (85)
- startbbs (72)
- webftp (82)
- vsvim (79)
本文暂时没有评论,来添加一个吧(●'◡'●)