[Developers] paths for referencing javascript files from client side in acre

Jason Douglas jason at metaweb.com
Sat Jul 4 20:01:11 UTC 2009


On Jul 4, 2009, at 12:38 PM, Iain Sproat wrote:

> I see the problem was mostly confusion on my part - the file was  
> sitting in the script folder and not the text files folder.  However  
> the word 'script' is ambiguous, I'd hazard a guess a lot of client  
> side js files have been created in the 'scripts' folder by accident.
>
> I was thinking that, in theory, we could add a parameter that could  
> turn off 'execution' of scripts by acre
>
> Rather than a parameter, I'd like to be able to call any script from  
> client side by default - if file '/date' sitting in the 'scripts'  
> folder returns an executed script, could a path be set up, e.g. '/ 
> client/date', that returns the unexecuted raw script for that very  
> same file?


Create a script called 'client' that does something like this:

	var id = acre.request.script.app.id + acre.request.path_info;
	var body = acre.freebase.get_blob(id, "raw").body;
	acre.write(body);

And that will do what you just described.

-jason



More information about the Developers mailing list