我曾经使用此代码从 Pharo 1.2 图像中提供来自 Comanche Web 服务器的静态文件:
创建服务 | contentPath dirPath svc ma | contentPath := 'htdocs'。 dirPath := FileDirectory 默认 fullNameFor: contentPath。 svc := (HttpService on: self port) 名称:'seaside-',自端口油脂串。 ma := ModuleAssembly 核心。 ma 别名:'/static' 到:[ ma serverRoot: dirPath。 ma documentRoot: dirPath. ma directoryIndex: 'index.html index.htm'。 ma serveFiles ]。 ma addPlug:自我。 svc 插件:ma rootModule。 ^ 服务端
如果来自http://samadhiweb.com/blog/2011.07.10.seaside.comanche.staticfiles.html的代码
不幸的是,这在 Pharo 1.3 上不再起作用。ModuleAssembly 类不再存在。那么如何设置 comanche 来提供静态文件呢?