@@ -31,12 +31,6 @@ impl M2Preset {
31
31
}
32
32
}
33
33
34
- const PATH_REQUIRE_JS : & ' static str =
35
- "/static/{version}/frontend/{vendor}/{theme}/{locale}/requirejs/require.js" ;
36
- const PATH_REQUIRE_CNF : & ' static str =
37
- "/static/{version}/frontend/{vendor}/{theme}/{locale}/requirejs-config.js" ;
38
- const PATH_CONF_POST : & ' static str = "/__bs/post" ;
39
-
40
34
///
41
35
/// The M2Preset adds some middleware, resources and
42
36
/// rewrites
@@ -52,25 +46,20 @@ impl Preset<AppState> for M2Preset {
52
46
// which is suitable for most routes.
53
47
//
54
48
let http_responders: Vec < ResourceDef > = vec ! [
55
- ( PATH_REQUIRE_JS , Method :: GET , handlers:: serve_r_js:: handle ) ,
56
- ( "/__bs/reqs.json" , Method :: GET , handlers:: requests:: handle) ,
57
- ( "/__bs/config.json" , Method :: GET , handlers:: config:: handle) ,
58
- ( "/__bs/build.json" , Method :: GET , handlers:: build:: handle) ,
59
- ( "/__bs/loaders.js" , Method :: GET , handlers:: loaders:: handle) ,
60
- ( "/__bs/seed.json" , Method :: GET , handlers:: seed:: handle) ,
49
+ handlers:: serve_r_js:: register ( self . options . require_path . clone ( ) ) ,
50
+ ( "/__bs/reqs.json" . to_string ( ) , Method :: GET , handlers:: requests:: handle) ,
51
+ ( "/__bs/config.json" . to_string ( ) , Method :: GET , handlers:: config:: handle) ,
52
+ ( "/__bs/build.json" . to_string ( ) , Method :: GET , handlers:: build:: handle) ,
53
+ ( "/__bs/loaders.js" . to_string ( ) , Method :: GET , handlers:: loaders:: handle) ,
54
+ ( "/__bs/seed.json" . to_string ( ) , Method :: GET , handlers:: seed:: handle) ,
61
55
] ;
62
56
63
57
//
64
58
// Async Responders are needed when there's additional
65
59
// work to be done in a handler.
66
60
//
67
61
let http_async_responders: Vec < AsyncResourceDef > = vec ! [
68
- ( PATH_CONF_POST , Method :: POST , handlers:: config_post:: handle) ,
69
- (
70
- PATH_REQUIRE_CNF ,
71
- Method :: GET ,
72
- handlers:: config_capture:: handle,
73
- ) ,
62
+ handlers:: config_capture:: register( self . options. require_conf_path. clone( ) )
74
63
] ;
75
64
76
65
let app = http_responders
0 commit comments