上一页 1 2 3 4 5 6 7 8 9 ··· 30 下一页
摘要: 🧩 背景 在做前端项目时,我们经常需要加载第三方网站的图片资源。例如在做电影列表展示时,你可能会加载豆瓣的图片地址: <img src="https://img9.doubanio.com/view/photo/s_ratio_poster/public/p2641806535.jpg" /> 这 阅读全文
posted @ 2025-06-05 08:19 PEAR2020 阅读(235) 评论(0) 推荐(0)
摘要: 解决浏览器跨域问题,express+http-proxy-middleware 的时候遇到问题: app.use('/api', createProxyMiddleware({ target: 'http://xxx.com', changeOrigin: true, logLevel: 'debu 阅读全文
posted @ 2025-06-05 02:04 PEAR2020 阅读(55) 评论(0) 推荐(0)
摘要: 1 .gitignore里加入了test/,没有生效? git已经cache test/ stop tracking : git rm -r --cached test/ commit: git commit -m "Update .gitignore and stop tracking test 阅读全文
posted @ 2024-06-29 00:46 PEAR2020 阅读(15) 评论(0) 推荐(0)
摘要: 网络基础知识https://zhuanlan.zhihu.com/p/65226634网络常用命令Docker Bridge 网络Docker Host 网络网络命名空间 阅读全文
posted @ 2024-06-27 04:06 PEAR2020 阅读(14) 评论(0) 推荐(0)
摘要: Volume - Data Volume:由Docker管理,持久化数据的最好方式 - Bind Mount 由用户指定存储的数据具体在系统什么位置 container内部是read-only image + read-write layer dockerfile里:Volume ["/app"] 阅读全文
posted @ 2024-06-26 09:11 PEAR2020 阅读(22) 评论(0) 推荐(0)
摘要: 背景 1. problem 1) 启动很慢 2)很耗费内存 只能local,不适合线上 => 如图所示,需要在生产服务器上install JVM + python解释器 + golang exe文件 => bad isolation => 连同操作系统一起隔离 容器其实是进程processes do 阅读全文
posted @ 2024-06-23 06:24 PEAR2020 阅读(14) 评论(0) 推荐(0)
摘要: 故障排查,数据分析,监控告警,保存现场1. 替换成另一个日志框架2. 拓展性3. 集成tracing(OpenTelemetry )metrics,logging4. 每个日志都要知道是什么请求的封装日志包 - base on zap 阅读全文
posted @ 2024-06-23 05:40 PEAR2020 阅读(13) 评论(0) 推荐(0)
摘要: 保证高可用的方法1. 日志2. 链路追踪3. 监控 1. 业务监控(领导层) OPS/DAU/访问状态 http code/业务接口(登陆注册聊天上传留言搜索) 2. system monitoring (运维) operating system: cpu/memory/disk usage/dis 阅读全文
posted @ 2024-06-22 22:19 PEAR2020 阅读(21) 评论(0) 推荐(0)
摘要: 1. map一定要初始化,slice可以不用初始化2. pointer一定要初始化var c *Course => must init => c = &Course{} or new(Course)3. for-loop的临时变量是一个值会变化的变量 var out []*int for i:= 0 阅读全文
posted @ 2024-06-22 10:17 PEAR2020 阅读(16) 评论(0) 推荐(0)
摘要: Mock Data 1. refactor code to use mock data 假设需要测试一个接口,只希望测试logic,并不希望有data层面的交互(test方法中需要初始化db等配置) 首先需要改造UserServer, 让 userData interface 注入,然后我可以实现u 阅读全文
posted @ 2024-06-21 07:00 PEAR2020 阅读(40) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 30 下一页