Prerequisites
🚀 Feature Proposal
For now it must be string or array of strings, but modern Node.js also supports URL for many APIs. It would be great to support it here too.
Motivation
root: new URL(".", import.meta.url) (or .toString()) fails because neither of URL nor file: protocol is supported. fileURLToPath is always required.
Example
fastify.register(fastifyStatic, {
root: new URL("assets/", import.meta.url)
});
Prerequisites
🚀 Feature Proposal
For now it must be string or array of strings, but modern Node.js also supports URL for many APIs. It would be great to support it here too.
Motivation
root: new URL(".", import.meta.url)(or.toString()) fails because neither of URL norfile:protocol is supported.fileURLToPathis always required.Example