Client-server stack for Web3! Turn your Raspberry Pi to a BAS server in minutes and enjoy the freedom of decentralized Web with a superior user experience!
Opinion: The sendFile method in the File protocol should be removed and the client should decide about it.
Right now, the fula-client imports the sendFile method from the @functionland/file-protocol and simply passes the filename to it. It is the file protocol that decides how to read the specified filename into a buffer.
In the file protocol, there is streamFile method that takes an AsyncIterable as the input and sends the data over the stream. This is all that the file protocol needs to do.
Opinion: The
sendFile
method in the File protocol should be removed and the client should decide about it.Right now, the
fula-client
imports thesendFile
method from the@functionland/file-protocol
and simply passes the filename to it. It is the file protocol that decides how to read the specified filename into a buffer. In the file protocol, there isstreamFile
method that takes anAsyncIterable
as the input and sends the data over the stream. This is all that the file protocol needs to do.