Re: Euphoria MVC updates

new topic     » goto parent     » topic index » view thread      » older message » newer message
jmduro said...

With example4.ex and the development server, I finally understood what was going wrong: in example3.ex and example4.ex, there is a condition of beeing in examples/ sub-directory. I removed the condition to get example4.ex working:

set_template_path( "../templates" ) 

instead of:

if search:ends( "examples", current_dir() ) then 
    -- make sure we can find our templates 
    -- if we're in the 'examples' directory 
    set_template_path( "../templates" ) 
end if 

I tried to make sure it would pick up the "templates" directory if you ran it from either the root project directory or the "examples" directory. If that's still no working then it needs more attention. How exactly are you running the examples?

jmduro said...

Now after reading once more Apache configuration on euphoria-mvc github page, I understand what I didn't before: to call euphoria-mvc code while adressing a different route, I need redirection in lighttpd configuration as mentionned under "# Send all non-existant paths to index.esp".

I thought it would be possible to call different cgi-scripts within same project folder but I understand it is not possible il I snd all non-existant paths to example3.ex. I expected a call to be http://127.0.0.1/example3.ex/index.html or better http://127.0.0.1/index.ex.

That's not really the intent here. This isn't meant to be a traditional "CGI script" that is called directly by the web server. It's meant to be path-based routing framework, so the web server should send any or all requests directly to the application for processing. I think the problem with the examples is that they're meant to either be run by a properly-configured web server or act as their own development server, and I've not made that clear. I need to make it more obvious which is the case for each example.

Currently, you have to either call app:run() when you're using a web server, or call server:start() to run the development server. Ultimately, I'd like to make it entirely transparent: if you run your application directly, it should fire up the built-in web server or refuse to start, and if your app is run by a web server it should determine this and just handle the route, produce the output, and then exit.

This feedback and testing is all very helpful though. Thank you!

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu