silvioprog / brookframework

Microframework which helps to develop web Pascal applications.
https://github.com/risoflora/brookframework
GNU Lesser General Public License v3.0
170 stars 37 forks source link

Small fix to static file broker, the static folder name/path didn't match #137

Closed MFernstrom closed 7 years ago

MFernstrom commented 7 years ago

Not sure if my fix is good or not, but it fixed the issue, hopefully someone more experienced can take a quick peek and Yay or Nay it.

silvioprog commented 7 years ago

Great. Could you provide a minimal example showing the problem? :-)

MFernstrom commented 7 years ago

No problem

BrookStaticFileRegisterDirectory('css/', PublicHTMLDir + 'css/'); Then try to access localhost:8080/css/style.css

MFernstrom commented 7 years ago

I'm running this on a Mac (El Capitan), possible it only affects OSX.

I also had to include the full path for things, one of the demos look like this MimeTypes.LoadFromFile('mime.types');

To make it work, I had to do MimeTypes.LoadFromFile(IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0)))+'mime.types');

It could be related I guess.

leledumbo commented 7 years ago

I also had to include the full path for things, one of the demos look like this MimeTypes.LoadFromFile('mime.types');

The assumption is that you run it from the same directory as the mime.types file. Otherwise, it follows whatever current working directory is, which could differ from one platform to another.

MFernstrom commented 7 years ago

I did place it in the same folder, still had to give full path.

leledumbo commented 7 years ago

I did place it in the same folder, still had to give full path.

Do you RUN it from the same folder?

MFernstrom commented 7 years ago

I ran it by using the Lazarus run function.

But that's a different issue, the code change only changes the static folder check with the missing /

leledumbo commented 7 years ago

I ran it by using the Lazarus run function.

Well, that's actually the problem with full path needs for mime.types.

But that's a different issue, the code change only changes the static folder check with the missing /

Yes, I know. That one is OK.

MFernstrom commented 7 years ago

Oh ok so the path issue isn't an issue after building/bundling, that's good news

MFernstrom commented 7 years ago

The file path for mime file I mean.

MFernstrom commented 7 years ago

Anything else I can provide?