{"id":15630817,"url":"https://github.com/jaywcjlove/sgo","last_synced_at":"2025-04-06T07:09:53.678Z","repository":{"id":35116525,"uuid":"44062617","full_name":"jaywcjlove/sgo","owner":"jaywcjlove","description":"A dev server for rapid prototyping. Setting a directory to a static server.It provides a 404 neat  interface for listing the directory's contents and switching into sub folders.","archived":false,"fork":false,"pushed_at":"2024-04-19T18:30:15.000Z","size":1190,"stargazers_count":207,"open_issues_count":6,"forks_count":42,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-05-28T13:33:44.434Z","etag":null,"topics":["javascript","mock-server","mocker-api","nodejs","proxy-server","server","server-go","sgo","ssr","typescript"],"latest_commit_sha":null,"homepage":"https://jaywcjlove.github.io/sgo","language":"EJS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaywcjlove.png","metadata":{"files":{"readme":"README-zh.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["jaywcjlove"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"custom":"https://jaywcjlove.github.io/sponsor.html"}},"created_at":"2015-10-11T17:42:38.000Z","updated_at":"2024-01-11T01:14:09.000Z","dependencies_parsed_at":"2023-01-15T14:09:49.303Z","dependency_job_id":"985fc090-6e0f-4114-baef-51fd344f524e","html_url":"https://github.com/jaywcjlove/sgo","commit_stats":{"total_commits":175,"total_committers":5,"mean_commits":35.0,"dds":0.0971428571428572,"last_synced_commit":"6b14d5159fc5a3112ede96f7f3c7d2ca3d48590b"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fsgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fsgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fsgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fsgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaywcjlove","download_url":"https://codeload.github.com/jaywcjlove/sgo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445667,"owners_count":20939958,"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":["javascript","mock-server","mocker-api","nodejs","proxy-server","server","server-go","sgo","ssr","typescript"],"created_at":"2024-10-03T10:36:37.405Z","updated_at":"2025-04-06T07:09:53.654Z","avatar_url":"https://github.com/jaywcjlove.png","language":"EJS","funding_links":["https://github.com/sponsors/jaywcjlove","https://jaywcjlove.github.io/sponsor.html"],"categories":[],"sub_categories":[],"readme":"[English](README.md) • \u003cruby\u003e [sgo](https://github.com/jaywcjlove/sgo-rs) \u003crt\u003erust\u003c/rt\u003e\u003c/ruby\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jaywcjlove/sgo\"\u003e\n    \u003cimg alt=\"sgo logo\" src=\"./img/banner.svg?sanitize=true\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jaywcjlove/sgo/actions\"\u003e\n    \u003cimg alt=\"Build \u0026 Deploy\" src=\"https://github.com/jaywcjlove/sgo/workflows/Build%20\u0026%20Deploy/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jaywcjlove/sgo/issues\"\u003e\n    \u003cimg alt=\"Issue\" src=\"https://img.shields.io/github/issues/jaywcjlove/sgo.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jaywcjlove/sgo/network\"\u003e\n    \u003cimg alt=\"Forks\" src=\"https://img.shields.io/github/forks/jaywcjlove/sgo.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jaywcjlove/sgo/stargazers\"\u003e\n    \u003cimg alt=\"Stars\" src=\"https://img.shields.io/github/stars/jaywcjlove/sgo.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jaywcjlove/sgo/releases\"\u003e\n    \u003cimg alt=\"Releases\" src=\"https://img.shields.io/github/release/jaywcjlove/sgo.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/sgo\"\u003e\n    \u003cimg alt=\"npm version\" src=\"https://img.shields.io/npm/v/sgo.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cimg align=\"right\" width=\"250\" src=\"./img/sgo.png\"\u003e\n\n用于快速原型设计的开发服务。它提供了一个简洁的界面，用于列出目录的内容并切换到子文件夹，以当前目录为根目录快速起一个静态服务。\n\n此外，它在提供静态站点方面也很棒。 如果目录包含 `index.html` ，则serve将自动呈现它而不是提供目录内容，并将任何 `.html` 文件作为呈现页面而不是文件内容作为明文提供。\n\n\n\u003e 更名: `ssr` =\u003e `sgo`  \n\u003e sgo: `Server Go` 的缩写  \n\n⚠️ `ssr` 已经捐赠给阿里某团队。\n\n\u003cimg src=\"./img/sgo-safari.png\"\u003e\n\n#### `特征`\n\n🗂 提供目录中的脚本，样式，图像等静态内容。   \n🖥 将所有非文件请求（如`/`或`/ admin`）重新路由到单个文件。   \n♻️ 添加，删除或修改项目文件时重新加载浏览器。  \n📚 可读的 TypeScript 源代码，鼓励学习和贡献。  \n💥 删除冗余的 [proxy](https://github.com/jaywcjlove/mocker-api) 功能, 代理功能请使用 [mocker-api](https://github.com/jaywcjlove/mocker-api)。  \n⚛️ 支持预览 React/Vue/Angular 项目的静态页面。\n\n\u003cbr /\u003e\n\n### 快速开始\n\n使用 `npm i sgo -D` 添加 `sgo` 作为 `dev` 依赖项或直接从终端运行：\n\n```bash\nnpm install -g sgo # 全局安装 sgo\nsgo # 创建一个服务\n# 或者\nnpx sgo [--port] [--dir]\n```\n\n\u003cbr /\u003e\n\n### 命令帮助\n\n```bash\nUsage: sgo [options]\n\nOptions:\n  --version      Show version number                                   [boolean]\n  --port, -p     Set the port.                          [number] [default: 1987]\n  --reload-port  Set the reload port.                  [number] [default: 19872]\n  --reload, -r   browser from reloading when files change.\n                                                       [boolean] [default: true]\n  --dir, -d      Specified directory.                     [string] [default: \"\"]\n  --browser, -b  Browser from opening when the server starts.\n                                                       [boolean] [default: true]\n  --fallback     The file served for all non-file requests.\n                                                          [string] [default: \"\"]\n  --help         Show help                                             [boolean]\n\nExamples:\n\n  $ sgo                            Start a dev server.\n  $ sgo --no-browser               Prevents the browser from opening when the\n                                   server starts.\n  $ sgo --no-reload                prevents the browser from reloading when\n                                   files change.\n  $ sgo --fallback dir/index.html  The file served for all non-file requests..\n  $ sgo -p 2019                    Designated port.\n  $ sgo -d node_modules/dir        Specified directory \"node_modules/dir\".\n\nCopyright 2019\n```\n\n在项目的 `package.json` 文件中使用 `npm` 脚本的示例：\n\n```json\n{\n  \"scripts\": {\n    \"start\": \"npx sgo -p 2019\"\n  }\n}\n```\n\n\u003cbr /\u003e\n\n### 在 Node.js 中使用\n\n```js\nconst sgo = require('sgo');\n\n// Create server\nsgo.default({ port: 1987, dir: '' });\n```\n\n```js\nimport server from 'sgo';\n\n// Create server\nserver({ port: 1987, dir: '' });\n```\n\n\u003cbr /\u003e\n\n### License\n\nMIT © [Kenny Wong](https://wangchujiang.com/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Fsgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaywcjlove%2Fsgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Fsgo/lists"}