0
我使用回形針,其具有以下配置的/config/s3.yml文件:S3.YML - 訪問一個變量?基於當前的Env?
common: &common
access_key_id: XXXXXXXXXX
secret_access_key: XXXXXXXXXXXXXXXXXXXX
development:
<<: *common
bucket: myapp-local-dev
test:
<<: *common
bucket: myapp-123-test
production:
<<: *common
bucket: myappname-313-production
在我看來,我想動態能夠做這樣的事情:
<img src="http://s3.amazonaws.com/myapp-local-dev/1/photos/15/1/thumb/Logo%20Design%20by%20kuda-1.jpeg" />
或
<img src="http://s3.amazonaws.com/myappname-313-production/1/photos/15/1/thumb/Logo%20Design%20by%20kuda-1.jpeg" />
不知何故,知道當前的環境,然後獲取存儲桶的名稱。可能?感謝