Specify data folder location?

Monkey Targets Forums/HTML5/Specify data folder location?

peterigz(Posted 2013) [#1]
Hello, is it possible to specify exactly where the data folder is located on the server as I've run into a problem with servers that use mod rewrite.

So if I try embedding the canvas into a post that has a url something like /a-post-about-monkey then it means the code tries loading the data from /a-post-about-monkey/data which of course isn't an actual location on the server.

Any ideas?

Thanks :-)


vmakar85(Posted 2013) [#2]
Hi, try play with
 BBHtml5Game.prototype.PathToUrl=function( path ){
	if( path.indexOf( "monkey:" )!=0 ){
		return path;
	}else if( path.indexOf( "monkey://data/" )==0 ) {
		return "data2/"+path.slice( 14 );
	}
	return "";
}
main.js file, as i think you can always return path like './myfolder/' or '../../myfolder/'


hehe i test it http://ibinaryway.blogspot.ru/2013/12/monkey-in-nodejs.html


Paul - Taiphoz(Posted 2013) [#3]
This is kinda handy and would allow you to easily set a few different data folders, for example you could have one for xmass with tons of xmass assets in it, and one for halloween, and of course a normal one.

loading from the appropriate data folder for the given date.


peterigz(Posted 2013) [#4]
Thanks vmakar85 this works well :)