Open enyo opened 9 years ago
If you tell me which version you'd prefer I can create a PR.
Having asset.exists([String path])
would be a good API. This only issue is that if the underlying file system is changed between a call to exists
and server
or read
the builtin 404 could still be returned. However for a deployed server the content in build/web
is not supposed to change.
Saying that build/web
is not supposed to change can also make it possible to cache the result of exists
calls and potentially what is read by server
or read
as well.
I want to render my own
404
pages, butAssets
doesn't give me a clean way to do that.It would be great if one of those could be implemented:
assets.fileExists()
function, so I can check if the file existsassets.serve()
so it throws an exception instead of responding with404
itself.What I'm doing to get this working is:
which obviously is less than ideal.