[Long] Moving a REST request from Desktop to Server

Richard Gaskin ambassador at fourthworld.com
Tue Mar 7 19:28:11 EST 2017


Malte Brill wrote:

 > I am trying to move a request I do from a desktop app to a liveCode
 > server script and am facing the problem that some of the stuff I use
 > (most of it libURL stuff) is not available on the server. Now I
 > wonder how I could translate it…

Have you considered running a standalone as your CGI?

Standalones can be run facelessly with a -ui flag, and while they 
require a one-time cost to set up a library to read stdin and parse the 
request and env vars, once you're set up you get something LiveCode 
Server can't offer:  complete compatibility with the LiveCode Script 
desktop syntax.

LC Server is great for many things, but since it doesn't work like LC on 
the desktop I don't use it for anything beyond testing.  I need to 
debug, and by not using the Server engine I can run my scripts right in 
the IDE.

Last week I was going to put together some notes on this to make using 
LC standalones as CGIs easier, but as luck would have it I couldn't get 
either Server or a standalone running as a CGI on either of my shared 
hosting accounts, for reasons that appear to be related to the RAM 
requirements from font loading:
http://quality.livecode.com/show_bug.cgi?id=14115

I have a workaround for that (thanks to some clever assist from Peter 
Brett and Mark Waddingham), but it's kinda funky and non-obvious to set 
up, so while it might work okay for me once in a while it's not the sort 
of thing I want to tell other people is reflective of how we do things 
in the LC world.  We are, after all, about simplicity, or at least 
strive for it.

But if you're on a VPS (about half our users are*) perhaps we can 
continue this discussion and explore simple means of using standalones 
as CGIs.  It really is a much simpler overall workflow once you get it 
going.


* I ran this survey on the LC forums - if you haven't voted please chime 
in on how you use LC on servers:

POLL: LiveCode Server deployment
http://forums.livecode.com/viewtopic.php?f=15&t=26772

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list