### Install fastify-seaweedfs plugin Source: https://github.com/trubavuong/fastify-seaweedfs/blob/master/README.md Instructions on how to install the fastify-seaweedfs plugin using the npm package manager. ```Bash $ npm install @trubavuong/fastify-seaweedfs ``` -------------------------------- ### Register and use fastify-seaweedfs plugin with Fastify Source: https://github.com/trubavuong/fastify-seaweedfs/blob/master/README.md Demonstrates how to register the fastify-seaweedfs plugin with a Fastify application, configure its endpoint and custom property name, and use the `app.swfs` object to retrieve files from the SeaweedFS server. ```JavaScript const fastify = require('fastify'); const plugin = require('@trubavuong/fastify-seaweedfs'); const app = fastify(); app.register(plugin, { endpoint: 'http://localhost:9333', // required, SeaweedFS endpoint name: 'swfs', // optional, custom property name, default 'fs' type: 'BLOCK_STORAGE' // optional, storage type, default 'BLOCK_STORAGE', currently we have only one type }); // later you can use app.swfs to interact with SeaweedFS server using corresponding storage APIs app.get('/files/:fid', async (req, res) => { const stream = await app.swfs.get(req.params.fid); res.send(stream); }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.