This repository was archived by the owner on Jan 31, 2025. It is now read-only.
File tree 2 files changed +5
-6
lines changed
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ function expressroutes(router, options) {
26
26
basepath = url . parse ( resource . api . basePath ) ;
27
27
mountpath = basepath . pathname ;
28
28
resourcepath = utils . prefix ( resource . api . resourcePath , '/' ) ;
29
- routes = options . routes [ mountpath ] ;
29
+ routes = options . routes [ resourcepath ] ;
30
30
31
31
routes && router . get ( docspath + resourcepath , function ( req , res ) {
32
32
res . json ( resource . api ) ;
Original file line number Diff line number Diff line change @@ -28,19 +28,18 @@ function swaggerize(options) {
28
28
routes = { } ;
29
29
30
30
options . resources . forEach ( function ( resource ) {
31
- var opts , basepath , mountpath ;
31
+ var opts ;
32
32
33
- basepath = url . parse ( resource . api . basePath ) ;
34
- mountpath = basepath . pathname ;
35
- routes [ mountpath ] = [ ] ;
33
+ resource . api . resourcePath = utils . prefix ( resource . api . resourcePath , '/' ) ;
34
+ routes [ resource . api . resourcePath ] = [ ] ;
36
35
37
36
opts = {
38
37
api : resource . api ,
39
38
handlers : resource . handlers ,
40
39
basedir : options . basedir
41
40
} ;
42
41
43
- Array . prototype . push . apply ( routes [ mountpath ] , builder ( opts ) ) ;
42
+ Array . prototype . push . apply ( routes [ resource . api . resourcePath ] , builder ( opts ) ) ;
44
43
} ) ;
45
44
46
45
options . routes = routes ;
You can’t perform that action at this time.
0 commit comments