Restheart V5安装文档

2020-12-07  本文已影响0人  cyclone_mi

安装Restheart

  curl https://raw.githubusercontent.com/SoftInstigate/restheart/master/docker-compose.yml --output docker-compose.yml
  sudo docker-compose up -d
  curl -i http://localhost:8080/ping
  sudo docker-compose logs -f
  sudo docker-compose down(注意: 千万**不要**加-v参数,会擦除已有数据)

配置开机自动启动

cd /etc/profile.d
sudo vi start_rest_heart.sh
docker-compose -f /home/phm/docker-compose.yaml up -d

配置文件存储服务例子

  curl -v -u admin:secret -X PUT -H "Content-Type: application/json" localhost:8080/mybucket.files
  curl -v -u admin:secret -X PUT -F "file=@/home/phm/test.jpg" localhost:8080/mybucket.files/mytest.jpg
  curl -u admin:secret http://localhost:8080/mybucket.files/mytest.jpg
  curl -u admin:secret http://localhost:8080/mybucket.files/mytest.jpg/binary

API

Url: http://localhost:8080/{bucketname}.files(bucketname为文件存储桶名称)
Method: PUT
Authorization: admin:secret(此参数放置在HTTP请求头中,键为Authorization,值为admin:secret的BASE64编码)
Content-Type: application/json

返回201说明成功
Url: http://localhost:8080/{bucketname}/{filename} (bucketname为文件存储桶名称, filename为上传后文件在桶中的名称)
Method: PUT
Authorization: admin:secret(此参数放置在HTTP请求头中,键为Authorization,值为admin:secret的BASE64编码)
Content-Type: multipart/form-data

返回201说明成功
Url: http://localhost:8080/{bucketname}/{filename} (bucketname为文件存储桶名称, filename为上传后文件在桶中的名称)
Method: GET
Authorization: admin:secret(此参数放置在HTTP请求头中,键为Authorization,值为admin:secret的BASE64编码)
Url: http://localhost:8080/{bucketname}/{filename}/binary (bucketname为文件存储桶名称, filename为上传后文件在桶中的名称)
Method: GET
Authorization: admin:secret(此参数放置在HTTP请求头中,键为Authorization,值为admin:secret的BASE64编码)
上一篇下一篇

猜你喜欢

热点阅读