Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 package:pub_server | |
| 2 ================ | |
| 3 | |
| 4 This package provides re-usable code for making a pub repository server. The | |
| 5 `package:pub_server/shelf_pubserver.dart` library provides a shelf HTTP handler | |
| 6 which provides the HTTP API used by the pub client. One can use different | |
| 7 backend implementations by implementing the `PackageRepository` interface of | |
| 8 the `package:pub_server/repository.dart` library. | |
| 9 | |
| 10 Example pub repository server | |
| 11 ----------------------------------------- | |
| 12 | |
| 13 An *experimental* pub server based on a file system can be found in | |
| 14 `bin/server.dart`. It uses a filesystem-based `PackageRepository` for storing | |
| 15 packages and has a read-only fallback to the real `pub.dartlang.org` site, | |
| 16 if a package is not available locally. This allows one to use all | |
| 17 `pub.dartlang.org` packages and have additional ones, on top of the publicly | |
| 18 available packages, available only locally. | |
| 19 | |
| 20 It can be run as follows | |
| 21 ``` | |
| 22 ~ $ git clone https://github.com/dart-lang/pub_server.git | |
| 23 ~ $ cd pub_server | |
| 24 ~/pub_server $ pub get | |
| 25 ... | |
| 26 ~/pub_server $ pub run server -d /tmp/package-db | |
|
Søren Gjesse
2015/02/16 11:54:51
With the sample moved to examples I guess this sho
kustermann
2015/02/16 14:44:02
Done.
| |
| 27 Listening on http://localhost:8080 | |
| 28 | |
| 29 To make the pub client use this repository configure your shell via: | |
| 30 | |
| 31 $ export PUB_HOSTED_URL=http://localhost:8080 | |
| 32 ``` | |
| 33 | |
| 34 Using it for uploading new packages to the locally running server or downloading | |
| 35 packages locally available or via a fallback to `pub.dartlang.org` is as easy | |
| 36 as: | |
| 37 | |
| 38 ``` | |
| 39 ~/foobar $ export PUB_HOSTED_URL=http://localhost:8080 | |
| 40 ~/foobar $ pub get | |
| 41 ... | |
| 42 ~/foobar $ pub publish | |
| 43 Publishing x 0.1.0 to http://localhost:8080: | |
| 44 |-- ... | |
| 45 '-- pubspec.yaml | |
| 46 | |
| 47 Looks great! Are you ready to upload your package (y/n)? y | |
| 48 Uploading... | |
| 49 Successfully uploaded package. | |
| 50 ``` | |
| 51 | |
| 52 The fact that the `pub publish` command requires you to grant it oauth2 access - | |
| 53 which requires a gmail account - is due to the fact that the `pub publish` | |
| 54 cannot work without authenticatinon or with another authentication scheme. | |
| 55 *But the information sent by the pub client is not used for this local server | |
| 56 at the moment*. | |
| 57 | |
| 58 | |
| 59 NOTE: This is package is an alpha version and is not recommended for production | |
| 60 use. | |
| OLD | NEW |