r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

Graham
18-Oct-2008
[3223x4]
doh ... I think I knew that!
I've done enough masquerading with Rebol as a http client!
Amazing how much stuff one forgets :(
And I see my problem ... I was looking for header information in 
url-translate prior to the headers being parsed which is why I couldn't 
see that information.
Dockimbel
18-Oct-2008
[3227]
Graham, as you have a fresh eye on mods building, if you notice things 
that might be improved, I'll be glad to hear your comments.
Graham
18-Oct-2008
[3228]
as far as I can tell ...just need more docs :)
Kaj
18-Oct-2008
[3229]
As in, more Dockimbels to develop on it? ;-)
Graham
18-Oct-2008
[3230x5]
Well, I made only a few changes and got this far

http://rebol.wik.is/Cheyenne/Mod-rest
I'm creating an API, and each api word maps to a single rsp page 
inside a %rest directory.  It is up to the rsp page to decide which 
actual function is being called, and to deal with all the parameters.
And also to deal with authentication.  Basic authentication will 
be used for each api call .. and the whole site will be behind https.
so, DELETE /@api/fax/jobno and GET /@api/fax/jobno both map to the 
same rsp page.
This scheme sound okay?
Dockimbel
18-Oct-2008
[3235x2]
I'm not a REST expert, but your code looks ok to me so far.
Tunneling Basic authentication through SSL is a wise decision.
Graham
19-Oct-2008
[3237x2]
What's the purpose of the .cache.efs file  that gets written . I 
think this was the file I saw before that I didn't have writes to 
write to the local filing system
rights to to write
Dockimbel
19-Oct-2008
[3239]
It's the cache generated for encapping Cheyenne by my encap-fs library. 
It's needed only for encapping.
Graham
19-Oct-2008
[3240x5]
Is the captcha library still working for other people on v 19 ?
Not working so far for me.
fordidden: charset "iIl1LoO0*ΰηθικω"
	allowed: exclude charset [
		#"0" - #"9" #"A" - #"Z" #"a" - #"z" "@ΰηθικω*"
	] fordidden

I think you meant 'forbidden
set-fonts-path: func [value [file!]][fonts-path: dirize value]

but set-fonts-path is not called inside 'captcha.r
I've got this in app-init.r


on-application-start: does [
	;--- add here your library / modules loading
    do %private/captcha.r
    captcha/set-fonts-path %private/fonts/
]
but for some reason the do %private/captcha.r is not firing.
Graham
20-Oct-2008
[3245x2]
More testing. If I remove this code form app-init.r it does not work.
If I don't have 

do %private/captcha.r
captcha/set-fonts-path %private/fonts/

also in my login.rsp, it doesn't work.
So, in summary I need this code both in app-init.r and in my login.rsp
Dockimbel
20-Oct-2008
[3247]
Didn't tested the Captcha code with v19, as a workaround try to move 
the code from on-application-start to on-session or use *do (instead 
of 'do) in on-application-start.
Graham
20-Oct-2008
[3248x6]
tried that too
*do
I think ... will try again.
Nope, neither of those work.  I neeed to have the code in my login.rsp 
page as well.
Tried again ... *do does work afterall.
Either that or I'm having a very non-deterministic day
Graham
21-Oct-2008
[3254x3]
Looks like I'm going to have a very few pages as entry points to 
the application ... and so all the code will only be in a few pages.
Anyone got a suggestion on how to modularise the app even more ..
I guess the more general question is how does one write large apps 
in RSP ...
Henrik
21-Oct-2008
[3257]
the same way you would a normal rebol app? there isn't much difference 
to RSP from running functions in a console.
Dockimbel
21-Oct-2008
[3258]
Think about RSP as just the display layer. Your application should 
be in .r script like you would do for any other REBOL app.
Graham
21-Oct-2008
[3259]
The View in MVC?
Dockimbel
21-Oct-2008
[3260]
Right.
Graham
21-Oct-2008
[3261]
Ok, that makes sense ... I didn't want 10 pages of code between <% 
%> !
Dockimbel
21-Oct-2008
[3262x2]
Build your app as it could have an alternative VID UI instead or 
just HTML.
That would be bad pratice.
Graham
21-Oct-2008
[3264x2]
well, I guess there isn't much published on what is good practice 
on writing RSP pages :)
And i've never done PHP etc
Dockimbel
21-Oct-2008
[3266]
True, but's it's no different from best pratices in ASP, JSP,...
Graham
21-Oct-2008
[3267x3]
No experience with any of those either ... but I've got a clue now 
:)
What exactly is the difference between 'do and '*do ?
ie. when should I use '*do ?
Dockimbel
21-Oct-2008
[3270]
'*do is just the native DO.
Graham
21-Oct-2008
[3271x2]
I know
So, why should I need to fall back to '*do ?