Is there something special I need to configure wit...
# cfml-general
d
Is there something special I need to configure within Lucee (via commandbox) to display .hbs files? When I go to browse a page, all that displays is "Not Found" but if I place an image in the same directory as the .hbs file in question, the image is displayed. For example, this works: https://127.0.0.1:443/assets/templates/test.txt but this doesn't https://127.0.0.1:443/assets/templates/test.hbs UPDATE: Locally, the hbs files will display. I'm setting up the app on a windows server and there is it not displaying the hbs files.
b
@Daryl Lackey If you want CommandBox to serve them up as static files, you need to add that extension to the whitelist of valid static files
CommandBox won't serve files it isn't explicitly configured to for security
d
Okay, I'll look into that. I know there is a switch you can set for development versus prod, could that be the difference?
b
So run this
Copy code
server set web.allowedExt=hbs
there is a switch you can set for development versus prod, could that be the difference?
No, CommandBox still uses the whitelist of file extensions regardless of the profile of the server
d
okay.
That worked!
👍 1
Thank you!
b
out of curiosity, what is an hbs file?
is it something common that CommandBox should maybe support by default?
d
handlebar file
javascript templating file
It's a safe file but I don't know if it's a common file.
👍 1
@Daryl Lackey ☝️ CommandBox 5.5 will serve this extension by default
d
Ah, I'm on 5.4.
Oh, you added it for the next release, cool!
One nice thing about it not being in there by default is that I learn you can whitelist file extensions. LOL Or in my case, I forgot I clearly must have added this long time ago and since forgot I did that. Adding it is for the best. 😉
b
The whitelist was added a few releases back as part of our secure-by-default lockdowns