在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:mul53/activestorage-ipfs开源软件地址:https://github.com/mul53/activestorage-ipfs开源编程语言:Ruby 98.9%开源软件介绍:Activestorage::IpfsThis gem extends the ActiveStorage::Service with an implementation for IPFS InstallationAdd this line to your application's Gemfile: gem 'activestorage-ipfs' And then execute:
UsageIn your Rails 5.2+ app, run:
This will copy over active_storage migration for creating the tables and then run:
We now need to tell activestorage to use the ipfs service. Declare a Ipfs service in ipfs:
service: Ipfs
api_endpoint: http://localhost:5001
gateway_endpoint: http://localhost:8080 Direct UploadDirect uploads can be used by installing
After installing the js package replace this line in require("@rails/activestorage").start() With this line: require("activestorage-ipfs-js").start() We annotate the file inputs with the direct upload url, and the ipfs api url
If Ipfs is running at localhost run the following cmds:
That's it! Upon submission the file upload begins DevelopmentAfter checking out the repo, run To install this gem onto your local machine, run ContributingBug reports and pull requests are welcome on GitHub at https://github.com/mul53/activestorage-ipfs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct. LicenseThe gem is available as open source under the terms of the MIT License. Code of ConductEveryone interacting in the Activestorage::Ipfs project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论