使用React和WebTorrent轻松搭建实时共享Web应用

开始

克隆仓库并安装依赖

$ git clone https://github.com/nabigraphics/pink-wt
$ cd pink-wt
$ npm install

配置服务器:

创建server/config.js文件,内容格式为:

module.exports = { port: Number }

启动构建

$ npm run build
$ npm start

开发与运行

  • 开发模式启动
  • $ npm run dev-server:通过 nodemon 启动开发服务器。
  • $ npm run dev:Webpack 开发环境打包。
  • 生产模式启动
  • $ npm run start:启动服务器。
  • $ npm run build:Webpack 生产环境构建。

重要文件说明

  • server/config.js:定义服务器端口配置。
  • webpack.config.js:Webpack 配置,用于模块化构建。

pink-wt提供便捷的WebTorrent共享方式,通过React简化了用户的体验。

zip 文件大小:1.05MB