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. 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.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sat, 20 Apr 2024 09:36:08 GMT
|