artyom-beilis / cppcms

CppCMS Framework
Other
443 stars 107 forks source link

Trying to use the cppcms file server for debugging purposes. #61

Closed Druidpeter closed 4 years ago

Druidpeter commented 5 years ago

I have enabled the file server in the json configuration file for my application, and explicitly set the directory root to the current working directory, but I am getting 404 errors.

I notice that my templates write "/subfolder/image.jpg", but when I examine the source code of the generated page in the browser, the image src attribute is "/appName/subfolder/image.jpg". So I think that my code is mistakenly trying to treat the static file "image.jpg" as a script name.

How do I change things so that "image.jpg" is properly recognized as a file for the file server to fetch?

masaoliou commented 5 years ago

I would double check cppcms::mount_point(cppcms::mount_point::match_script_name,"/seg1/seg2/(seg3)",1) and HTTP server's configuration to ensure that the two match.

Druidpeter commented 5 years ago

Ok. Thank you, masaoliou.