{"id":20507286,"url":"https://github.com/hangjob/egg-bag-framework","last_synced_at":"2026-03-16T22:31:57.650Z","repository":{"id":199865744,"uuid":"703957897","full_name":"hangjob/egg-bag-framework","owner":"hangjob","description":"🍁基于Egg.js封装框架，扩展常用模块jwt、令牌桶、参数校验、加解密，多文件上传等等，开箱即用","archived":false,"fork":false,"pushed_at":"2024-01-15T10:40:39.000Z","size":379,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-16T03:07:43.502Z","etag":null,"topics":["eggjs","mysql","nodejs","redis"],"latest_commit_sha":null,"homepage":"","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/hangjob.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}},"created_at":"2023-10-12T08:51:37.000Z","updated_at":"2024-10-20T11:59:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5f00ed1-0488-4126-889b-d128b695f5bf","html_url":"https://github.com/hangjob/egg-bag-framework","commit_stats":null,"previous_names":["hangjob/egg-bag-framework"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hangjob%2Fegg-bag-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hangjob%2Fegg-bag-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hangjob%2Fegg-bag-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hangjob%2Fegg-bag-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hangjob","download_url":"https://codeload.github.com/hangjob/egg-bag-framework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234157867,"owners_count":18788496,"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":["eggjs","mysql","nodejs","redis"],"created_at":"2024-11-15T20:13:10.623Z","updated_at":"2025-09-25T08:31:43.319Z","avatar_url":"https://github.com/hangjob.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# egg-bag-framework\n\n🍁基于Egg.js封装框架，扩展常用模块jwt、令牌桶、参数校验、加解密，多文件上传等等，开箱即用\n\n该框架，面向于企业中的后端程序，代码下载下来后，自行更改mysql、redis配置\n\n## 开始\n\n```bash\n$ npm install\n```\n\n## 创建软连接\n\n```bash\n$ npm link\n$ npm link egg-bag-framework // 应用目录\n```\n\n## 应用项目部署-服务器\n将应用部署到服务器上，`app`，`config`，`package.json`，`app.js`\n```json\n{\n    \"start\": \"egg-scripts start --daemon --port=7010 --title=egg-bag\"\n}\n```\n```bash\nnpm install\nnpm run start # npm run stop 如果有先暂停项目以免端口占用\n# 会一生成一个守护进程 http://127.0.0.1:7010/\n```\n## nginx\n添加一个反向代理到 http://127.0.0.1:7010/\n```nignx\nlocation ^~ /\n{\n    proxy_pass http://127.0.0.1:3010/;\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header REMOTE-HOST $remote_addr;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection $connection_upgrade;\n    proxy_http_version 1.1;\n    add_header X-Cache $upstream_cache_status;\n    if ( $uri ~* \"\\.(gif|png|jpg|css|js|woff|woff2)$\" )\n    {\n        expires 30d;\n    }\n    proxy_ignore_headers Set-Cookie Cache-Control expires;\n    proxy_cache cache_one;\n    proxy_cache_key $host$uri$is_args$args;\n    proxy_cache_valid 200 304 301 302 10m;\n}\n```\n\n\n\n## 附带功能\n### 前端压缩视频\n大文件放到前端压缩，会很好的减轻服务器的压力\n```html\n\n\u003cscript src=\"https://unpkg.com/@ffmpeg/ffmpeg@0.9.5/dist/ffmpeg.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://code.jquery.com/jquery-2.1.4.min.js\"\u003e\u003c/script\u003e\n\n\u003ch2\u003e视频前端压缩\u003c/h2\u003e\n\u003cvideo id=\"video\" controls\u003e\u003c/video\u003e\u003cbr/\u003e\n\u003cinput type=\"file\" id=\"upload\"\u003e\n\u003cp id=\"text\"\u003e\u003c/p\u003e\n\u003cscript\u003e\n    const { createFFmpeg, fetchFile } = FFmpeg;\n    const text = document.getElementById('text');\n    const ffmpeg = createFFmpeg({\n        log: true,\n        progress: ({ ratio }) =\u003e {\n            text.innerHTML = `完成率: ${(ratio * 100.0).toFixed(2)}%`;\n        },\n    });\n    const transcode = async ({ target: { files } }) =\u003e {\n        const { name } = files[0];\n        text.innerHTML = '正在加载 ffmpeg-core.js';\n        await ffmpeg.load();\n        text.innerHTML = '开始压缩';\n        ffmpeg.FS('writeFile', name, await fetchFile(files[0]));\n        // '-b','2000000'  值越小  压缩率越大\n        await ffmpeg.run('-i', name, '-b', '2000000', 'put.mp4');\n        text.innerHTML = '压缩完成';\n        const data = ffmpeg.FS('readFile', 'put.mp4');\n        const video = document.getElementById('video');\n        video.src = URL.createObjectURL(new Blob([ data.buffer ], {\n            type: 'video/mp4'\n        }));\n    };\n    document.getElementById('upload').addEventListener('change', transcode);\n\u003c/script\u003e\n```\n\n### 帮助文档\n\nhttps://juejin.cn/post/7288178532862083112\nhttps://www.kancloud.cn/han88829/book/2025973\n\n### 数据库\nhttps://blog.csdn.net/ab15176142633/article/details/120064660\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhangjob%2Fegg-bag-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhangjob%2Fegg-bag-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhangjob%2Fegg-bag-framework/lists"}