{"id":17242744,"url":"https://github.com/imcuttle/github-similar-server","last_synced_at":"2025-04-14T03:25:48.002Z","repository":{"id":32509729,"uuid":"135789414","full_name":"imcuttle/github-similar-server","owner":"imcuttle","description":"A github similar static server with a markdown renderer.","archived":false,"fork":false,"pushed_at":"2023-01-23T20:40:35.000Z","size":351,"stargazers_count":2,"open_issues_count":21,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T14:34:40.862Z","etag":null,"topics":["github","github-like","server","static"],"latest_commit_sha":null,"homepage":"","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/imcuttle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-06-02T05:14:14.000Z","updated_at":"2020-02-18T08:59:11.000Z","dependencies_parsed_at":"2023-02-13T03:00:30.185Z","dependency_job_id":null,"html_url":"https://github.com/imcuttle/github-similar-server","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fgithub-similar-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fgithub-similar-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fgithub-similar-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fgithub-similar-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcuttle","download_url":"https://codeload.github.com/imcuttle/github-similar-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248814707,"owners_count":21165809,"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":["github","github-like","server","static"],"created_at":"2024-10-15T06:13:58.000Z","updated_at":"2025-04-14T03:25:47.982Z","avatar_url":"https://github.com/imcuttle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-similar-server\n\n[![build status](https://img.shields.io/travis/imcuttle/github-similar-server/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/github-similar-server)\n[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/github-similar-server.svg?style=flat-square)](https://codecov.io/github/imcuttle/github-similar-server?branch=master)\n[![NPM version](https://img.shields.io/npm/v/github-similar-server.svg?style=flat-square)](https://www.npmjs.com/package/github-similar-server)\n[![NPM Downloads](https://img.shields.io/npm/dm/github-similar-server.svg?style=flat-square\u0026maxAge=43200)](https://www.npmjs.com/package/github-similar-server)\n\nA github similar static server with a markdown renderer.\n\n## Usage\n\n### CLI\n\n```bash\nnpm i github-similar-server -g\ngithub-similar-server -h\n```\n\n### Package\n\n```bash\nnpm i github-similar-server --save\n```\n\n```javascript\nconst app = require('express')()\nconst gss = require('github-similar-server')\n\n// Use as middleware\napp.use('__', gss())\n\n// Or create an express server\nconst gssApp = gss({\n  port: 10000, // required!\n  basePath: '/' // public path\n}).then(app =\u003e {\n  // some code here\n})\n\n// gssApp.close(() =\u003e { console.log('closed') })\n```\n\n## Options\n\n#### `root`\n\ngithub-similar-server works on which file or folder. (_required_)\n\n- Type: `string`\n\n#### `port`\n\nthe service port\n\n- Type: `number`\n- Default: `8080`\n\n#### `basePath`\n\nthe service's base path\n\n- Type: `string`\n- Default: `'/'`\n\n#### `silent`\n\nDo not log anything\n\n- Type: `boolean`\n- Default: `false`\n\n#### `enableMarkdown`\n\nEnable markdown render\n\n- Type: `boolean`\n- Default: `true`\n\n#### `enableStatic`\n\nEnable static file service\n\n- Type: `boolean`\n- Default: `true`\n\n#### `markdownTemplate`\n\nThe path of markdown's template\n\n- Type: `string`\n- Default: [`./src/template.html`](./src/template.html)\n\n#### `markdownTemplateString`\n\nThe string source of markdown's template, It has more higher priority. \n\n- Type: `string`\n\n#### `templateParameters`\n\nExtra parameters of template\n\n- Type: `{}`\n\n#### `cache`\n\n- Type: `string`\n- Default: `'max-age=-1'`\n\n#### `baseDir`\n\n`baseDir` is not recommended to be assigned if you don't know what you are doing.\n\nBecause it has some troubles in ecstatic. https://github.com/jfhbrook/node-ecstatic/issues/235 \n\n- Type: `string`\n- Default: `req.baseUrl`\n\n**Rest options extend [ecstatic](https://github.com/jfhbrook/node-ecstatic) options**\n\n## Rule\n\n1. Support gfm and render github style markdown when visit `/README.md` or `/path/to/md.md`.\n\n2. The service would response index.html when contains index.html and README.md via url `/`.\n\n3. It would response raw markdown text when with query string `?raw=true`.\n\n## About markdownTemplate\n\nUse [Lodash.template](https://lodash.com/docs/4.17.10#template) with template data:\n\n* title\n* markdownHTML\n* filename\n\n## Related\n\n- [remark-preset-gfm](https://github.com/imcuttle/remark-preset-gfm) - Remark preset for gfm (GitHub Favorite Markdown)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fgithub-similar-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcuttle%2Fgithub-similar-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fgithub-similar-server/lists"}