File tree 5 files changed +68
-0
lines changed
5 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Credentials for uploading packages to S3, these can be blank if you're not
2
+ # publishing locally.
3
+ S3_BUCKET =
4
+ S3_ACCESS_KEY =
5
+ S3_SECRET_KEY =
6
+ # Not needed if the S3 bucket is in US standard
7
+ S3_REGION =
8
+
9
+ # Credentials for talking to github, can be blank if you're not logging in.
10
+ #
11
+ # When registering a new application, be sure to set the callback url to the
12
+ # address `http://localhost:4200/authorize/github`.
13
+ GH_CLIENT_ID =
14
+ GH_CLIENT_SECRET =
15
+
16
+ # Key to sign and encrypt cookies with
17
+ SESSION_KEY = badkey
18
+
19
+ # Location of the *postgres* database
20
+ # (eg. postgres://postgres:@localhost/cargo_registry)
21
+ DATABASE_URL = postgres://postgres:@localhost/cargo_registry
22
+
23
+ # Remote and local locations of the registry index
24
+ GIT_REPO_URL = file://./tmp/index-bare
25
+ GIT_REPO_CHECKOUT = ./tmp/index-co
Original file line number Diff line number Diff line change
1
+ import Ember from 'ember' ;
2
+
3
+ export default Ember . ObjectController . extend ( {
4
+ } ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ Router.map(function() {
16
16
this . route ( 'download' ) ;
17
17
this . route ( 'versions' ) ;
18
18
this . route ( 'reverse_dependencies' ) ;
19
+
20
+ // Well-known routes
21
+ this . route ( 'docs' ) ;
19
22
} ) ;
20
23
this . route ( 'me' , function ( ) {
21
24
this . route ( 'crates' ) ;
Original file line number Diff line number Diff line change
1
+ import Ember from 'ember' ;
2
+ import Crate from 'cargo/models/crate' ;
3
+
4
+ export default Ember . Route . extend ( {
5
+ setupController : function ( controller , data ) {
6
+ var crate ;
7
+
8
+ if ( data instanceof Crate ) {
9
+ crate = data ;
10
+ } else {
11
+ crate = data . crate ;
12
+ }
13
+
14
+ var documentation = crate . get ( 'documentation' ) ;
15
+
16
+ if ( documentation ) {
17
+ window . location = documentation ;
18
+ } else {
19
+ // Redirect to the crate's main page and show a flash error if
20
+ // no documentation is found
21
+ var message = 'Crate does not supply a documentation URL' ;
22
+ this . controllerFor ( 'application' ) . set ( 'nextFlashError' , message ) ;
23
+ this . replaceWith ( 'crate' , crate ) ;
24
+ }
25
+
26
+ this . _super ( controller , crate ) ;
27
+ } ,
28
+ } ) ;
Original file line number Diff line number Diff line change
1
+ <div id =" crates-heading" >
2
+ <img class =" logo" src =" /assets/circle-with-i.png" />
3
+ <h1 >Documentation for <em >{{ name }} </em ></h1 >
4
+ </div >
5
+
6
+ <p >
7
+ Redirecting you to <code >{{ documentation }} </code >…
8
+ </p >
You can’t perform that action at this time.
0 commit comments