javascript - Json 未在 github 存储库中更新
问题描述
所以,我有一些在运行代码时更新的 JSON,我注意到它在我的机器上运行时会更新,但在我托管代码时不会更新,对于托管,我使用 heroku,我使用 github 作为存储库。我确定它与配置问题有关,因为您不能只更新代码而不在 git 中提交它,我遇到的问题是如何让 JSON 在 github 中更新。我正在使用 Node.js 和 Fs(文件系统)示例:code.js
const fs = require('fs');
if(true) {
const content = {"name": "joe"};
fs.writefilesync('./some.json', JSON.stringify(content),{flag: 'w+'});
/*
on my machine this works perfectly as it should,
however when i cloud host it, the JSON doesnt update.
*/
};
解决方案
推荐阅读
- javascript - 加载时运行方法 - Angular 4
- android - Android Webview - navigator.geolocation.getCurrentPosition 不起作用
- c - c语言按结构中的值排序
- jakarta-ee - 测试 DeltaSpike 存储库无法注入 EntityManager
- shell - 使用 Snakemake 生成报告时出现“没有这样的文件或目录”错误
- ruby - 学习 Ruby 语法的最官方文档或方法是什么?
- javascript - Django:使用 javascript 数组填充表单字段
- spring - Spring Integration JDBC 元数据存储
- c# - EF 代码优先如何使用实体检索导航属性?
- xodus - xodus 并行线程的写入性能?