Smalltalk/X WebserverDocumentation of class 'HTTPPluggableActionService': | |
Class: HTTPPluggableActionServiceInheritance:Object | +--HTTPService | +--HTTPPluggableActionService
Description:A service which associates page-URLS with a block's evaluation. Can be used for quick ad-hoc and Expecco-driven webservices, and also to provide the glue to Pharo services (see JRPCServer). The registered block (-> register:as:) is evaluated with the httpRequest object as argument. Blocks are registered to react on absolute URL-paths, and all request-URLs below a particular action link are handled by this block. For example, if a block is registered as '/foo/bar', then also '/foo/bar/baz', '/foo/bar/bla' and '/foo/bar/baz/bla/bla' are handled by that block. Instance protocol:registration
Examples:|server service| server := HTTPServer serverOnPort:9091. service := HTTPPluggableActionService new. service register:[ :req | req reply:'Hello World' ] as:'hello'. service register:[ :req | req reply:'Bla' ] as:'hello/bla'. service registerServiceOn:server |
|
ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 06:32:23 GMT |