- Dart Cookbook
- Ivo Balbaert
- 223字
- 2021-08-05 17:42:44
Hosting your own private pub mirror
Another possibility for when the pub repository is not reachable (because you have no Internet access or work behind a very strict firewall) is to host your own private pub mirror.
How to do it...
Follow these steps to host your own private pub mirror:
- You need a server that speaks to the pub's HTTP API. Documentation on that standalone API does not yet exist, but the main pub server running at pub.dartlang.org is open source with its code living at https://github.com/dart-lang/pub-dartlang. To run the server locally, go through these steps:
- Install the App Engine SDK for Python.
- Verify that its path is in
$PATH
. - Install the pip installation file, beautifulsoup4, and pycrypto webtest packages.
- From the top-level directory, run this command to start the pub server
dev_appserver.py app
. - Verify that it works in your browser with
http://localhost:8080/
.
- You need to set a
PUB_HOSTED_URL
environment variable to point to the URL of your mirror server, so that the pub will look there to download the hosted dependencies, for example,PUB_HOSTED_URL = http://me:mypassword@127.0.0.1:8042
. - Manually upload the packages you need to your server, visit
http://localhost:8080/admin
(sign in as an administrator), go to the Private Key tab, and enter any string into the private key field.
How it works...
The server from can be run from an Intranet as well.
推薦閱讀
- 通信網(wǎng)絡(luò)基礎(chǔ)與設(shè)備
- 數(shù)據(jù)通信網(wǎng)絡(luò)實踐:基礎(chǔ)知識與交換機技術(shù)
- 光網(wǎng)絡(luò)評估及案例分析
- 從區(qū)塊鏈到Web3:構(gòu)建未來互聯(lián)網(wǎng)生態(tài)
- HTML5 Game development with ImpactJS
- 互聯(lián)網(wǎng)基礎(chǔ)資源技術(shù)與應(yīng)用發(fā)展態(tài)勢(2021—2023)
- 雷達饋線技術(shù)
- Getting Started with Grunt:The JavaScript Task Runner
- WordPress Web Application Development
- 網(wǎng)絡(luò)利他行為研究:積極心理學(xué)的視角
- 中國互聯(lián)網(wǎng)發(fā)展報告2021
- 精通SEO:100%網(wǎng)站流量提升密碼
- 物聯(lián)網(wǎng)與智慧農(nóng)業(yè)
- Enterprise ApplicationDevelopment with Ext JSand Spring
- 物聯(lián)網(wǎng)傳感器技術(shù)與應(yīng)用