You are not logged in.
Pages: 1
Hello Ab,
I face a problem that how to register a folder like as "wwwroot" in web app,
also "Cache" folder too
I am using method based SOA
so that I would place all the js, css, ico, img for <link> in index,html
(eg. <script src="static/js/jquery.min.js"></script>)
Please point me the right direction, thanks
Last edited by Mark (2022-09-23 03:26:01)
Offline
Hi, Ab.
Could change the Views folder to others? (eg. "wwwroot" folder)
Could change the .static folder to others? (eg. "resource" folder)
Thanks
Offline
You can customize the TMvcViewsAbstract instance via the ViewTemplateFolder and ViewStaticFolder properties.
The views folder is also customizable by the TMvcViewsMustacheParameters.Folder value.
Please search a little in the source comments before asking.
Offline
Yes, I have studied comment several times and tried,
it could change the "Views" folder to other name.
BUT, the ".static" folder couldn't because it is read-only property, couldn't write value.
from code:
property ViewStaticFolder: TFileName
read fViewStaticFolder;
Last edited by Mark (2022-09-28 02:45:11)
Offline
It could be changed from ViewTemplateFolder as '\.static' sub-folder.
I have made the property writable:
https://github.com/synopse/mORMot2/commit/b832c99f
Offline
The new update program could complie ViewStaticFolder := 'ccc',
but my browser could not access file under "Views/ccc/blog.css"
Code:
MvcViewsAbstract := TMvcViewsAbstract.Create(Factory.InterfaceTypeInfo, (RestModel as TRestServer).LogClass);
loMvcViewsAbstract.ViewStaticFolder := 'ccc';
fMainRunner := TMvcRunOnRestServer.Create(Self,nil,'',MvcViewsAbstract);
Last edited by Mark (2022-09-28 12:29:12)
Offline
That function only changes folder location but not URI.
It is my I misunderstand.
I choose to use the default ".static" folder. : )
Thanks Ab
Last edited by Mark (2022-09-28 15:13:10)
Offline
Pages: 1