This guide introduces two methods to deploy the front-end of a web application on BTFS, and compares the differences between BTFS, CDN, and Amazon S3.
Please refer to: Install BTFS Node
Execute the btfs add
command:
$ btfs add <file-name>
// Output
added QmdBX8seLx4TGHwr8Tu9L2QSByaJ9bbFUpxFvKAYyxCmnb <file-name>
163 B / 163 B [=======================================================] 100.00%
$ btfs add -r <dir-name>
// Output
added QmdBX8seLx4TGHwr8Tu9L2QSByaJ9bbFUpxFvKAYyxCmnb <dir-name/file-name>
added QmdBX8seLx4TGHwr8Tu9L2QSByaJ9bbFUpxFvKAYyxCmnb <dir-name/file-name>
......
added QmdBX8seLx4TGHwr8Tu9L2QSByaJ9bbFUpxFvKAYyxCmnb <dir-name>
163 B / 163 B [=======================================================] 100.00%
Upload files to the BTFS network:
$ btfs storage upload <file-hash>
$ btfs storage upload <session-id> status | jq '.Status'
Open your browser and enter the URL: https://gateway.btfs.io/btfs/<file-hash>
to view the deployed website.
Execute the btfs get
command:
// get file
$ btfs get <file-hash>
// get dir(files)
$ btfs get <dir-hash>
This will download the respective file from the BTFS network.
To delete files from the network, run:
$ btfs rm <file-hash>