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
[3231x4]
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 ?
Dockimbel
21-Oct-2008
[3273]
Webapps are, from v 19, contained in their own context (object!). 
'do will first bind the loaded code to the webapp context before 
executing it.
Graham
21-Oct-2008
[3274]
and if you're not using a webapp?
Dockimbel
21-Oct-2008
[3275x2]
*do is just a fallback, if 'do is crashing your code ;-). It should 
be used, but as I had some context issues while testing with my own 
webapps, I've added it as a workaround while figuring out how to 
fix those issues.
if the RSP is not inside a webapp, then 'do will just call the native 
do.
Graham
21-Oct-2008
[3277]
Ok.  Thx
Dockimbel
21-Oct-2008
[3278]
it should = it shouldn't
Graham
21-Oct-2008
[3279]
need R3
Dockimbel
21-Oct-2008
[3280]
badly