Hi everyone.I have a demo project with RoJavaScriptHttpDispatcher configured with the path property = ‘/’.
Maybe i am missing something but I need to send the request from the browser just with the URL (http(s)://www.misite.com) without adding folder name (http(s)://www.misite.com/foldername)
I need to use it because i have a web application that mix html content and javascript functions that use remote services to send and recive data. I did open a domain and i need that the web application load and respond when i enter de URL for example: http://mysite.com.
The configuration of the javascript dispatcher needs a different value than just “/” so when i assign the “/app/” value to the property “path” i need in the URL to write “http://mysite.com/app”.What i don´t want is to write “/app/”, just the domain.
Which is the right way to achive this?
by the way i have implemented messages dispatchers (bin and json).
Hello. I did try the code but it didn’t works, the event is never reached.
I did some changes to the file uROHTTPFileDispatcher.pas and now a get what i want but i’m not sure if those changes will affect in other way.
The code i had changed is:
ProcessMethod
…
if fServeFilesFromFolder then
if(AnsiSameText(’/’+lPatchComponents[1]+’/’, Path)) or (Path=’/’) then begin
if(lPathComponentes.Count = 2) and (Path<>’/’)then begin
…
end
end
else begin
lFilePath := fFolder; if(Path <> ‘/’) then d:=2 else d := 1;
for i := d to lPathComponents.Count - 1 do begin
…
end
if((lPathComponents.Coint > 2) and (lPathComponents[lPathComponents.Count-1] = ‘’)) or ((lPathComponents.Coint = 2) and (lPathComponents[lPathComponents.Count-1] = ‘’) and (Path = ‘/’)) then begin
…
end;
…
end;