{"id":15486108,"url":"https://github.com/hold-baby/swartz","last_synced_at":"2026-01-07T15:04:53.783Z","repository":{"id":31450897,"uuid":"127926013","full_name":"hold-baby/swartz","owner":"hold-baby","description":"node web server","archived":false,"fork":false,"pushed_at":"2022-12-08T02:37:15.000Z","size":360,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-10-19T07:05:09.152Z","etag":null,"topics":["dev","server","swartz"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/hold-baby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-03T15:04:10.000Z","updated_at":"2020-08-07T08:25:24.000Z","dependencies_parsed_at":"2023-01-14T19:04:08.197Z","dependency_job_id":null,"html_url":"https://github.com/hold-baby/swartz","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/hold-baby%2Fswartz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hold-baby%2Fswartz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hold-baby%2Fswartz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hold-baby%2Fswartz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hold-baby","download_url":"https://codeload.github.com/hold-baby/swartz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246056658,"owners_count":20716779,"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":["dev","server","swartz"],"created_at":"2024-10-02T06:06:34.379Z","updated_at":"2026-01-07T15:04:53.717Z","avatar_url":"https://github.com/hold-baby.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swartz\n![logo](./public/img/swartz_logo.png)\n### 安装\n```\nnpm  i  swartz -g\n```\n### API\n创建配置文件(必须)sw-config.js\n```\n// 服务端部署\nswartz.task('app'){\n\t// web服务\n\tswartz.webServer({\n\t\tport : xxxx, // 端口\n\t\tpath : 'www', // 服务目录\n\t\thttps : { // 是否启用https服务,不启用则不用配置\n\t\t\tport : xxxx, // https端口\n\t\t\tkey : 'path', // 证书key\n\t\t\tcert : 'path', // 证书cert\n\t\t\tonly : false // http服务重定向至https服务,默认false\n\t\t},\n\t\thistory : false // 是否启用history模式\n\t});\n\t// 静态资源服务\n\tswartz.static({\n\t\tport : xxxx, // 端口\n\t\tpath : 'static', // 资源目录\n\t\trouter : { \t // 路由转发配置(如果配置了path，则router配置不生效)\n\t\t\t'/assets' : '/static/assets'\n\t\t}\n\t});\n\tswartz.uploadServer({\n\t\tprot : xxxx, // 端口\n\t\ttarget : 'target', // 上传目标目录\n\t\tkeys : 'keys' // 上传验证凭证(可选)\n\t})\n};\n\n// 发布配置\nswartz.task('push', function(){\n\tswartz.pushServer({\n\t\turl : 'http://127.0.0.1:xxxx/push', // 上传接收地址\n\t\tpath : 'path', // 待上传目录（会打包成压缩包上传）\n\t\tkeys : 'keys' // 上传验证凭证(可选)\n\t})\n});\n```\n### 使用\n```\nswartz init // 创建配置文件\nswartz app // 执行配置文件中的app任务\nswartz push // 执行配置文件中的push任务\nswartz app =\u003e sw app // swartz可简写成sw\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhold-baby%2Fswartz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhold-baby%2Fswartz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhold-baby%2Fswartz/lists"}