@@ -27,10 +27,7 @@ module Bottle {
2727 */
2828 module App {
2929 /** Gets a reference to a Bottle application (an instance of `bottle.Bottle`) */
30- API:: Node instance ( ) { result = bottle ( ) .getMember ( "Bottle" ) .getReturn ( ) }
31-
32- /** Gets a reference to a Bottle application (an instance of `bottle.app`) */
33- API:: Node app ( ) { result = bottle ( ) .getMember ( "app" ) .getReturn ( ) }
30+ API:: Node app ( ) { result = bottle ( ) .getMember ( [ "Bottle" , "app" ] ) .getReturn ( ) }
3431 }
3532
3633 /** Provides models for functions that are possible "views" */
@@ -42,13 +39,13 @@ module Bottle {
4239 ViewCallable ( ) { this = any ( BottleRouteSetup rs ) .getARequestHandler ( ) }
4340 }
4441
42+ /** Get methods that reprsent a route in Bottle */
4543 string routeMethods ( ) { result = [ "route" , "get" , "post" , "put" , "delete" , "patch" ] }
4644
4745 private class BottleRouteSetup extends Http:: Server:: RouteSetup:: Range , DataFlow:: CallCfgNode {
4846 BottleRouteSetup ( ) {
4947 this =
5048 [
51- App:: instance ( ) .getMember ( routeMethods ( ) ) .getACall ( ) ,
5249 App:: app ( ) .getMember ( routeMethods ( ) ) .getACall ( ) ,
5350 bottle ( ) .getMember ( routeMethods ( ) ) .getACall ( )
5451 ]
@@ -68,8 +65,10 @@ module Bottle {
6865
6966 /** Provides models for the `bottle.response` module */
7067 module Response {
71- /** Gets a reference to the `bottle.response` module. */
72- API:: Node response ( ) { result = bottle ( ) .getMember ( "response" ) }
68+ /** Gets a reference to the `bottle.response` module or instantiation of Bottle Response class. */
69+ API:: Node response ( ) {
70+ result = [ bottle ( ) .getMember ( "response" ) , bottle ( ) .getMember ( "Response" ) .getReturn ( ) ]
71+ }
7372
7473 /** A response returned by a view callable. */
7574 class BottleReturnResponse extends Http:: Server:: HttpResponse:: Range {
0 commit comments