借助github或其他网站的服务器模拟数据

========================

其实非常简单,假设要模拟JSON数据只要把json文件传到网站的服务器

github举例

只需新建仓库或使用已有仓库或使用博客仓库等,把相应的json文件推送到远程仓库。

而后就可以直接对着该json进行网络请求https://raw.githubusercontent.com/adong666666/adong666666.github.io/master/runinto/CulturalRelicsData.json

博客举例

把json文件放到博客源文件的目录或子目录下,这里我放在子目录runinto下

图片或其他资源也都放在博客源文件的目录或子目录下,这里我放在子目录image下

部署博客

zhangsaidong@zhangsaidongs-MacBook-Pro blog % hexo g && hexo d
INFO  Validating config
WARN  Deprecated config detected: "external_link" with a Boolean value is deprecated. See https://hexo.io/docs/configuration for more details.
INFO  Start processing
INFO  Files loaded in 594 ms
INFO  Deleted: json/CulturalRelicsIntroduction.json
INFO  Generated: runinto/Models3DData.json
INFO  Generated: runinto/CulturalRelicsData.json
INFO  Generated: runinto/PaintingRomanceData.json
INFO  Generated: runinto/StylePredictData.json
INFO  Generated: runinto/IntroductionData.json
INFO  Generated: runinto/PaintingModelsData.json
INFO  Generated: books/index.html
INFO  Generated: works/index.html
INFO  Generated: 2021/03/31/20210331Moya使用/index.html
INFO  Generated: 2021/03/31/20210331HandyJSON使用/index.html
INFO  Generated: 2021/03/31/20210331iOS开发之真机调试下查看本地沙盒数据摘录/index.html
INFO  Generated: 2021/03/20/20210320git发布tag/index.html
INFO  Generated: 2021/03/21/20210320Perfect部署到云服务器摘录/index.html
INFO  Generated: 2021/03/18/Mac命令行关闭端口/index.html
INFO  Generated: 2021/03/16/20210316Swift多线程/index.html
INFO  Generated: 2019/08/03/iOS-Localizable-strings/index.html
INFO  Generated: about/index/resume.html
INFO  Generated: archive/index.html
INFO  Generated: archives/2019/index.html
INFO  Generated: 2020/09/30/学术论文——基于ARKit技术的文物交互式相机App的设计与实现/index.html
INFO  Generated: 2019/07/06/hello-world/index.html
INFO  Generated: archives/2019/07/index.html
INFO  Generated: archives/page/2/index.html
INFO  Generated: archives/2020/index.html
INFO  Generated: archives/2019/08/index.html
INFO  Generated: archives/2021/03/index.html
INFO  Generated: archives/2020/09/index.html
INFO  Generated: archives/2021/index.html
INFO  Generated: archives/2021/page/2/index.html
INFO  Generated: archives/2021/03/page/2/index.html
INFO  Generated: tags/iOS/index.html
INFO  Generated: tags/多线程/index.html
INFO  Generated: tags/Swift/index.html
INFO  Generated: tags/博文/index.html
INFO  Generated: tags/framework/index.html
INFO  Generated: tags/server/index.html
INFO  Generated: index.html
INFO  Generated: tags/network/index.html
INFO  Generated: page/2/index.html
INFO  Generated: tags/软件测试/index.html
INFO  Generated: tags/论文/index.html
INFO  Generated: tags/git/index.html
INFO  Generated: tags/DataBase/index.html
INFO  Generated: about/index.html
INFO  Generated: 2021/03/22/20210322iOS之制作xcframework摘录/index.html
INFO  Generated: archives/index.html
INFO  Generated: tags/index.html
INFO  Generated: 2021/03/01/README/index.html
INFO  Generated: 2021/03/01/README.en/index.html
INFO  Generated: 2021/03/03/20210331SQLite.swift使用/index.html
INFO  Generated: 2021/03/27/20210327gitbook配置/index.html
INFO  Generated: 2021/03/20/Perfect部署到服务器工作记录/index.html
INFO  52 files generated in 157 ms
INFO  Validating config
WARN  Deprecated config detected: "external_link" with a Boolean value is deprecated. See https://hexo.io/docs/configuration for more details.
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
[master c336836] Site updated: 2021-03-31 11:58:37
 53 files changed, 466 insertions(+), 1 deletion(-)
 delete mode 100644 json/CulturalRelicsIntroduction.json
 create mode 100644 runinto/CulturalRelicsData.json
 create mode 100644 runinto/IntroductionData.json
 create mode 100644 runinto/Models3DData.json
 create mode 100644 runinto/PaintingModelsData.json
 create mode 100644 runinto/PaintingRomanceData.json
 create mode 100644 runinto/StylePredictData.json
Enumerating objects: 228, done.
Counting objects: 100% (228/228), done.
Delta compression using up to 16 threads
Compressing objects: 100% (84/84), done.
Writing objects: 100% (123/123), 28.58 KiB | 2.86 MiB/s, done.
Total 123 (delta 55), reused 0 (delta 0)
remote: Resolving deltas: 100% (55/55), completed with 38 local objects.
To https://github.com/adong666666/adong666666.github.io.git
   03af415..c336836  HEAD -> master
Branch 'master' set up to track remote branch 'master' from 'https://github.com/adong666666/adong666666.github.io.git'.
INFO  Deploy done: git

将博客部署之后,就可以用对应url进行网络请求,如这里使用的是https://zsd.name/runinto/IntroductionData.json

图片资源也可以拿到,如https://zsd.name/images/xinyi.jpg

这便相当于有个现成的模拟服务器,各种软件开发,这样模拟数据是不是很轻松!