Re: Pengine url
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 02/08/2014 08:22 PM, Jan Wielemaker wrote: > On 02/08/2014 08:13 PM, Anne Ogborn wrote: >> If I rebase the server what happens with pengine connections? > > That is a problem. The pengines.pl library defines them at > root(pengines/create), etc. pengines.js hard-codes them at > /pengines/create, etc. Not really sure how to fix that. I > guess the closest we can get is by ensuring that <prefix>/js/pengines.js > produces a version that is compatible with the handers at the > server side. > > Just a tought: if you put a relative location in a script file, > does it resolve relative to the script or the page that has a > link loading the script? That clearly doesn't work :-( Fetching the URL of pengines.js is possible, but not so easily that it is a great idea. I've added a partial work-around by adding `server: string` to the Pengine configuration object. The pengine interaction is found at server + pengine/create (etc) If server is not given, it is "/". At least that allows hacking around this without modifying pengines.js. In addition, it allows copying pengines.js to any web server and using it for cross-site scripting, or chatting to different pengine servers from the same JavaScript script. Hope this helps to keep moving forwards ... Cheers --- Jan