{"id":21905401,"url":"https://github.com/hex7c0/top-vhost","last_synced_at":"2025-04-15T23:46:59.104Z","repository":{"id":57378077,"uuid":"21327694","full_name":"hex7c0/top-vhost","owner":"hex7c0","description":"top-down virtual host for Nodejs","archived":false,"fork":false,"pushed_at":"2024-04-22T23:55:32.000Z","size":411,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-23T00:49:41.227Z","etag":null,"topics":["nodejs","proxies","vhost"],"latest_commit_sha":null,"homepage":"https://github.com/hex7c0/top-vhost","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hex7c0.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-29T16:54:01.000Z","updated_at":"2020-06-14T20:57:46.000Z","dependencies_parsed_at":"2024-04-23T00:47:30.586Z","dependency_job_id":"b16cf5ef-460f-46e1-914f-15e2fa7225bf","html_url":"https://github.com/hex7c0/top-vhost","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hex7c0%2Ftop-vhost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hex7c0%2Ftop-vhost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hex7c0%2Ftop-vhost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hex7c0%2Ftop-vhost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hex7c0","download_url":"https://codeload.github.com/hex7c0/top-vhost/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173060,"owners_count":21224481,"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":["nodejs","proxies","vhost"],"created_at":"2024-11-28T16:33:14.781Z","updated_at":"2025-04-15T23:46:59.078Z","avatar_url":"https://github.com/hex7c0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [top-vhost](https://github.com/hex7c0/top-vhost)\n\n[![NPM version](https://img.shields.io/npm/v/top-vhost.svg)](https://www.npmjs.com/package/top-vhost)\n[![Linux Status](https://img.shields.io/travis/hex7c0/top-vhost.svg?label=linux-osx)](https://travis-ci.org/hex7c0/top-vhost)\n[![Windows Status](https://img.shields.io/appveyor/ci/hex7c0/top-vhost.svg?label=windows)](https://ci.appveyor.com/project/hex7c0/top-vhost)\n[![Dependency Status](https://img.shields.io/david/hex7c0/top-vhost.svg)](https://david-dm.org/hex7c0/top-vhost)\n[![Coveralls](https://img.shields.io/coveralls/hex7c0/top-vhost.svg)](https://coveralls.io/r/hex7c0/top-vhost)\n\nTop-Down virtual host for [nodejs](http://nodejs.org/).\nOptional, you can set this module like a proxy or a redirect.\n\n## Installation\n\nInstall through NPM\n\n```bash\nnpm install top-vhost\n```\nor\n```bash\ngit clone git://github.com/hex7c0/top-vhost.git\n```\n\n## API\n\ninside expressjs project\n```js\nvar vhost = require('top-vhost');\nvar father = require('express')();\nvar child = require('express')();\n\nchild.get('/',function(req,res) {\n\n  res.send('hello');\n});\n\nfather.use(vhost({\n  domain: 'foo.com',\n  framework: child,\n})).listen(3000);\n```\n\n### vhost(options)\n\n#### options\n\n - `domain` - **String | RegExp** Name or Regex of virtual host *(required)*\n - `dynamic` - **String** Path of dynamic configuration json file (only with Proxies). Array of hosts *(default \"disabled\")*\n - `static` - **String** Path of static configuration json file. Preserve options *(default \"disabled\")*\n - `redirect` - **Array** Array of url that will be redirected to this domain *(default \"disabled\")*\n - `redirectStatus` - **Number** Set type of HTTP header for redirect (permanently 301 or temporary 307) or use another *(default \"301\")*\n - `insensitive` - **Boolean** Set True if want parse insensitive match *(default \"sensitive\")*\n - `stripWWW` - **Boolean** Stripe all \"www.\" url *(default \"disabled\")*\n - `stripOnlyWWW` - **Boolean** Redirect all \"www.\" url to \".\" url *(default \"disabled\")*\n - `stripHTTP` - **Boolean** Redirect all \"http://\" to \"https://\" url *(default \"disabled\")*\n - `stripHTTPS` - **Boolean** Redirect all \"https://\" to \"http://\" url *(default \"disabled\")*\n - `framework` - **Function** Functions related to this virtual host *(optional)*\n - `proxies` - **Object** Object for build http proxy, related to [`http-proxy`](https://github.com/nodejitsu/node-http-proxy) *(optional)*\n\nrelated to https://github.com/nodejitsu/node-http-proxy/blob/master/lib/http-proxy.js#L29-L52\n\n## Examples\n\nTake a look at my [examples](examples)\n\n### [License GPLv3](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhex7c0%2Ftop-vhost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhex7c0%2Ftop-vhost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhex7c0%2Ftop-vhost/lists"}