{"id":20103273,"url":"https://github.com/bmfe/eros-node-server","last_synced_at":"2025-05-06T08:31:14.611Z","repository":{"id":90566730,"uuid":"119645724","full_name":"bmfe/eros-node-server","owner":"bmfe","description":"针对weex 的二次开发框架eros 做的一个热更新check／add／download zip的一个服务端","archived":false,"fork":false,"pushed_at":"2018-02-13T09:44:49.000Z","size":28,"stargazers_count":20,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T10:27:39.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmfe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-31T06:36:40.000Z","updated_at":"2019-05-24T09:28:23.000Z","dependencies_parsed_at":"2023-03-16T13:00:38.643Z","dependency_job_id":null,"html_url":"https://github.com/bmfe/eros-node-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmfe%2Feros-node-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmfe%2Feros-node-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmfe%2Feros-node-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmfe%2Feros-node-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmfe","download_url":"https://codeload.github.com/bmfe/eros-node-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252648579,"owners_count":21782408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T17:35:35.264Z","updated_at":"2025-05-06T08:31:14.605Z","avatar_url":"https://github.com/bmfe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eros热更新服务端(express+mongodb)\n\n说明：\n====================================\n本demo 是针对[eros-template](https://github.com/bmfe/eros-template)（一个针对weex进行二次封装的非常优秀的框架）做的一个check版本热更新的服务端，基于[eros-publish](https://github.com/bmfe/eros-publish)做了一些小改动和添加了一些小功能。\n\n如果对你有用的话，请右上角点个star\n\n\n使用：\n====================================\n\n下载\n----------------------------------------\n使用git从[eros-node-server](https://github.com/shawn-tangsc/eros-node-server)主页下载项目\n\n``` bash\ngit clone https://github.com/shawn-tangsc/eros-node-server\n```\n前期准备\n----------------------------------------\n+ 下列是mac下环境执行的语法，需要先安装[homebrew](https://brew.sh/)，linux下同理用相应的包管理工具下载。\n\n\t```\n\tbrew install bsdiff\n\tbrew install bspatch\n\t```\n\n\n初始化\n----------------------------------------\n执行：\n\n``` bash\ncd eros-node-server\nnpm install\n```\n\n\n修改配置文件\n----------------------------------------\n1.在本项目中修改db/mongoose 下的mongodb的ip和port 为本地local path\n\n``` bash\nvar mongoose = require(\"mongoose\");\nvar DB_URL = 'mongodb://localhost/home'\n```\n\n2.修改根目录中的config.js 中的zipPath！\n\n+ 下面这个路径配置的是你差分包和全量包里面的路径，可以自己去查一下\n\n\t``` bash\n\tmodule.exports = {\n\t    zipPath:\u003ceros-template 内eros.dev.js中的 diff.pwd配置的路径\u003e\n\t}\n\t```\n\n\n+ 下面去修改你eros-template 里面的-----》eros.dev.js\n\t\n\t```\n\t 'diff': {\n\t        'pwd': \u003c你希望全量包放的位置，这里需要注意，他会在你指定的目录下多新建一个目录\u003e,\n\t        'proxy': `\u003c本项目启动后的url或者ip\u003e:3001/app/downloadIncrementZip`\n\t    },\n\t```\n\n+ 下面去修改你eros-template 里面的-----》eros.native.js\n\n\t```\n\t'url': {\n\t        ...\n\t        'bundleUpdate': `\u003c本项目启动后的url或者ip\u003e:3001/app/check`,\n\t        ...\n\t    },\n\t```\n\n生成差分包和全量包\n---------\n\n+ 在你的eros-template 目录根据实际情况执行，eros会将你的包放到你指定的目录下面\n\n\t```\n\teros build //生成全量包\n\teros build -d //生成差分包\n\t```\n+ 这里要注意：并不会去保存差分包信息到服务器上！\n\t\n\t每次有新版本后，你在执行\n\t```\n\teros build -d \n\t```\n\t的时候系统会自动去你配置的diff.pwd所指定的路径下，根据当前最新的包去生成和目标目录下的所有全量包之间的差分包，所以你需要在本项目根目录中config.js中配置\n\t\n\t```\n\tmodule.exports = {\n\t   ...\n\t    cliPath:'/Users/tangsicheng/myCode/my_github_code/private/home-project/home-app-eros/dist/js'\n\t}\n\t```\n去告诉本服务器，如果客户端请求的是差分包，应该去哪里找。\n\n\n启动服务器\n----------------------------------------\n\n+ 在本项目的目录下，执行下列命令，这会给你在本地启动一个端口为3001的服务器\n\n\t```\n\tnpm run start\n\t```\n\n+ 启动mongodb的本地服务\n\n\t```\n\tmongod\n\t```\n\n将eros全量包信息保存到服务器\n----------------\n+ 执行下列命令，可以让你将eros-template里面之前生成的全量包的信息（\u003cyour eros project\u003e/dist/version.json）保存的服务器上面,\n\n\t```\n\teros build -s http://localhost:3001/app/add\n\t```\n\t\n\n测试\n----------------------------------------\n\n+ 然后打开你eros项目中platform对应的移动端项目就可以直接在模拟器或真机上测试热更新了。。\n\n---\n\u003ccenter\u003e\u0026copy;2017 Shawn TangSiCheng\u003c/center\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmfe%2Feros-node-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmfe%2Feros-node-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmfe%2Feros-node-server/lists"}