Giter VIP home page Giter VIP logo

bce-sdk-js-usage's Introduction

bce-sdk-js samples

初始化

运行 sample 代码之前,首先需要修改一下 config.json,添加 ak, sk, bucket 的配置:

项目 默认值
port 8800
uptoken_url http://localhost:8801/ack
enable_sts true
ak <your ak>
sk <your sk>
bucket <your bos bucket>
endpoint https://bj.bcebos.com

安装依赖

npm install

根据配置文件 config.json,自动生成一些代码

npm run prepare

启动 server

类别 命令
frontend node frontend/main.js
Node.js backend cd backend/nodejs; node main.js
php backend cd backend/php; php main.php
java backend cd backend/java; mvn clean install exec:java -Dexec.mainClass=com.baidu.inf.bce.App

然后在浏览器里面打开 http://localhost:8800/moe/3in1.html 即可

关于 crossdomain.xml

IE下面跨域请求是通用 moxie.swf 发起的,因此涉及到一些 crossdomain.xml 文件的配置。

地址 作用 状态
http://doc.baidubce.com/crossdomain.xml DocClient.Document.createFromBos() 正常
http://vod.baidubce.com/crossdomain.xml VodClient.Media.apply() 正常
http://vod-gfsc6mdbcfkc35xq.bj.bcebos.com/crossdomain.xml BosClinet.putObject... 需要初始化
http://<my-bucket>.bj.bcebos.com/crossdomain.xml BosClinet.putObject.... npm run prepare自动初始化
http://foobar.exp.bcevod.com/crossdomain.xml Flash播放器 需要初始化,另外访问权限受到策略组防盗链的影响

bce-sdk-js-usage's People

Contributors

leeight avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.