ludo
ludo

Reputation: 553

How do we deploy a Pharo seaside web application?

I know there is a good explanation in the book Entreprise Pharo for deployment production over a Linux server. I followed the tutorial and was able to deploy the same project. However the project contained only a simple class 'MyFirstWebApp' and did not include Seaside framework. The run script was as followed:

ZnServer defaultOn: 8080. ZnServer default logToStandardOutput. ZnServer default delegate map: 'image' to: MyFirstWebApp new; map: 'redirect-to-image' to: [ :request | ZnResponse redirect: 'image' ]; map: '/' to: 'redirect-to-image'. ZnServer default start.

What about if you have a project with many classes using Seaside framework? I repeated the same procedure for my own Seaside project but I get a message error WARequestContextNotFound when I launch the run.st script with the following command ./pharo myapp.image run.st. Any idea?

Upvotes: 4

Views: 804

Answers (1)

Esteban A. Maringolo
Esteban A. Maringolo

Reputation: 1218

You're mixing the use of pure Zinc Server delegates with the handling of Seaside Applications. Zinc provides a "server adaptor" for Seaside, that can be setup using ZnZincServerAdaptor startOn: 8080 (or any port of your choice).

If you want to run a Seaside web application, you must deploy an image with the Seaside framework installed in it, along with your own classes (MyFirstWebApp and friends).

So your run.st would look more like:

ZnZincServerAdaptor  startOn: 8080.
ZnZincServerAdaptor default server debugMode: true.
ZnServer default logToStandardOutput.

"Here you register the Seaside application _class_"
(WAAdmin register: MyFirstWebApp asApplicationAt: 'image')
    preferenceAt: #serverPath put: '/'.
WAAdmin defaultDispatcher defaultName: 'image'.

Upvotes: 6

Related Questions