编辑 ~/.cargo/config
,修改第 3 - 5 行:
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'tuna'
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
TypeScript 32 hrs 2 mins ████████████▉░░░░░░░ 64.6% | |
JSON 6 hrs 7 mins ██▍░░░░░░░░░░░░░░░░░ 12.3% | |
Markdown 4 hrs 38 mins █▊░░░░░░░░░░░░░░░░░░ 9.3% | |
Docker 1 hr 19 mins ▌░░░░░░░░░░░░░░░░░░░ 2.7% | |
CSS 1 hr 8 mins ▍░░░░░░░░░░░░░░░░░░░ 2.3% |
编辑 ~/.cargo/config
,修改第 3 - 5 行:
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'tuna'
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
这里以使用 TypeScript 开发,以及使用 Axios 库发起请求的例子。
没接触过 TypeScript 的话可以看下我之前的文章,有一个开发入门介绍: 快速上手 TypeScript 。
因为需要切换测试环境和生产环境,所以这里把配置单独保存在 config 里了,类型是:
// src/config/avata.ts
People
![]() :bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |