{"id":21417912,"url":"https://github.com/msg-systems/lite-proxyserver","last_synced_at":"2026-06-28T18:31:46.319Z","repository":{"id":102119782,"uuid":"83553613","full_name":"msg-systems/lite-proxyserver","owner":"msg-systems","description":"Lightweight development only node server that serves a web app, serves mock rest endpoints and allows proxy requests to real backends.","archived":false,"fork":false,"pushed_at":"2018-09-27T08:30:19.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-04-03T17:06:15.859Z","etag":null,"topics":[],"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/msg-systems.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-01T12:46:27.000Z","updated_at":"2018-09-27T08:30:21.000Z","dependencies_parsed_at":"2023-07-11T14:34:21.752Z","dependency_job_id":null,"html_url":"https://github.com/msg-systems/lite-proxyserver","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":"0.34615384615384615","last_synced_commit":"0aa24eb7652c83d02b905798e3dd51d4b7215dd9"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/msg-systems/lite-proxyserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msg-systems%2Flite-proxyserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msg-systems%2Flite-proxyserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msg-systems%2Flite-proxyserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msg-systems%2Flite-proxyserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msg-systems","download_url":"https://codeload.github.com/msg-systems/lite-proxyserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msg-systems%2Flite-proxyserver/sbom","scorecard":{"id":665584,"data":{"date":"2025-08-11","repo":{"name":"github.com/msg-systems/lite-proxyserver","commit":"0aa24eb7652c83d02b905798e3dd51d4b7215dd9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T17:54:46.684Z","repository_id":102119782,"created_at":"2025-08-21T17:54:46.684Z","updated_at":"2025-08-21T17:54:46.684Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34900367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-22T19:18:07.118Z","updated_at":"2026-06-28T18:31:46.292Z","avatar_url":"https://github.com/msg-systems.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lite-proxyserver\nLightweight _development only_ node server that serves a web app, mock rest endpoints and allows proxy requests to real backends.\n\n[![Dependency Status](https://david-dm.org/msg-systems/lite-proxyserver.svg)](https://david-dm.org/msg-systems/lite-proxyserver)\n[![npm version](https://badge.fury.io/js/lite-proxyserver.svg)](http://badge.fury.io/js/lite-proxyserver)\n[![Build Status](https://travis-ci.org/msg-systems/lite-proxyserver.svg?branch=master)](https://travis-ci.org/msg-systems/lite-proxyserver)\n\n## Why\n\nDuring SPA development you want to code and test your SPA as fast as possible. Long term deployment round trips are not desired \nby your developers. The need for a fast and independent development deployment encourages a lite-server. The node based server is \nrunning locally and serves the SPA contents (HTML, CSS, JS). Changes to our development files can be '[watch](https://github.com/gruntjs/grunt-contrib-watch)'ed additionally in order\nto live update your coding changes to the server. \n\nDuring further development your team will encounter the need for REST endpoints. In a first step you want to mock those as easy as\npossible. This lite-server enables you to use a REST middleware pointing to a specific REST service implementation based on [connect-rest](https://github.com/imrefazekas/connect-rest).\n\nAfter covering SPA development and REST mock implementation you finally want to run your whole app in a real environment. When\nyou start deploying and testing your app in the runtime environment you still will encounter the need for local bugfixing against\na running environment. The local running lite-server now comes in and provides you a way to configure your node server to proxy\nrequests against any real backend environment. So the SPA content is provided from local node server and the SPA rest endpoint will\ntarget the same local node server - but this one will proxy those requests to your target environment. This way you wont get any\n[CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) problems and you can dynamically switch the backend between a local\nmock implementation, a colleagues implementation or a stable environment. \n\n## Architecture\n\nThe [lite-proxyserver](https://github.com/msg-systems/lite-proxyserver) depends on several modules. Most important dependency is [connect](https://github.com/gruntjs/grunt-contrib-connect). \nWhile you could build it also on other server implementations just like [express](https://expressjs.com/) or [hapi](https://hapijs.com/) we had to choose a specific server \nimplementation early some years ago and came up with [connect](https://github.com/gruntjs/grunt-contrib-connect). We just rely on the ability \nto use server middlewares as easy as possible.\n\nSo based on the first dependency all further middlewares are [connect](https://github.com/gruntjs/grunt-contrib-connect) based.\nWe use [connect-rest](https://github.com/imrefazekas/connect-rest) for the local REST service implementation and [connect-proxy](https://github.com/drewzboto/grunt-connect-proxy).\nA simple redirect middleware is handwritten. A proxyPassReverse functionality is provided for response headers handwritten and for html body content rewriting we are using [tamper](https://github.com/fgnass/tamper).\n\nThe following image should visualize the local [lite-proxyserver](https://github.com/msg-systems/lite-proxyserver) including all middlewares used.\n![architecture execution view](https://github.com/msg-systems/lite-proxyserver/raw/master/doc/execution%20view.png)\n\nAs you should have noticed by now this module strongly depends on [grunt](https://github.com/gruntjs/grunt). The server integrates well in a grunt build process.\n\n## Installation\n\nThe recommended installation method is a local NPM install for your project:\n\n```bash\n$ npm install lite-proxyserver --save-dev\n```\n\nBasically you simple add it as a devDependency into your projects package.json.\n\nInside your projects Gruntfile.js you can integrate the lite-proxyserver by this snippet\n\n```js\nmodule.exports = function (grunt) {\n    grunt.loadNpmTasks(\"lite-proxyserver\")\n};\n```\n  \n## Configuration\n\nThe configuration of the lite-proxyserver and all its features is done within the package.json of your project.\nAlternatively a different configuration can be provided by setting the '--package.json' command line option.\n```\ngrunt lite-proxyserver --package.json=packageTest.json\n```\n\nThe entries in the package.json will be validated with [duckyjs](https://github.com/rse/ducky) using the following specification\n\n```\n{\n    mock?:      ([{\n            enabled?:           boolean,\n            ctx?:               string,\n            fallback?:          string,\n            file:               string\n        }*] | {\n            enabled?:           boolean,\n            ctx?:               string,\n            fallback?:          string,\n            file:               string\n        }),\n    proxy?:      {\n        enabled?:               boolean,\n        targetHosts:    {\n            @:              {\n                host:           string,\n                port:           number\n            }    \n        },\n        target:                 string,\n        host?:                  string,\n        port?:                  number,\n        https?:                 boolean,\n        base?:                  string,\n        redirectRootToApp?:     string,\n        cors?:                  boolean,\n        proxyPassReverse?:      boolean,\n        proxies?:               [object*]\n    }\n}\n```\n\nSince most of them have defaults or some are not self explaining see the following explainations:\n\n| configuration entry | command line option | default | explanation |\n| ------------------- | ------------------- | ------- | ----------- |\n| mock | - | - | can be either one configuration object or be an array of those objects |\n| mock.enabled | --mock.enabled | true | mock implementation is generally activated by defining a mock.file; this switch exists to disable the mocking without deleting the rest of the configuration |\n| mock.ctx | --mock.ctx | '/mock' | the context for local REST services; mocked services must use a unique context beside the proxied services because this way the middlewares can seperate mock requests from proxy requests |\n| mock.fallback | --mock.fallback | - | in case that a combination of mock and proxy are used it is often important to not proxy all request. Often you want to proxy some of the services and use mocks for the rest. The fallback redirects not proxied requests by redirecting them to the specific mock definition |\n| mock.file | --mock.file | - | the mock file is a string pointing to the mock implementation. That implementation should require the [connect-rest](https://github.com/imrefazekas/connect-rest) middleware and export it as 'rest'; An example can be found in [uica-skeleton](https://github.com/msg-systems/uica-skeleton) |\n| proxy.enabled | --proxy.enabled | true | proxy functionality is generally activated; this switch exists to disable the proxy without deleting the rest of the configuration |\n| proxy.targetHosts | --proxy.targetHosts.{name}.host --proxy.targetHosts.{name}.port | - | in order to switch proxy targets fast you can define all your possible targets in this place. The @ enables you to give each target a specific name that can be used as a reference at proxy.target |\n| proxy.target | --proxy.target | - | this chooses the concrete proxy target from the proxy.targetHosts list |\n| proxy.host | --proxy.host | 'localhost' | this is the local node servers hostname. Your browser should be able to fetch your SPA from the defined proxy.host:proxy.port |\n| proxy.port | --proxy.port | 2345 | this is the local node servers port. Your browser should be able to fetch your SPA from the defined proxy.host:proxy.port |\n| proxy.https | --proxy.https | false | simple switch that determines the local node servers protocol. By default it uses http but it can be switched to https |\n| proxy.base | --proxy.base | 'htdocs' | this is the document root directory for the static content your node server should deliver |\n| proxy.redirectRootToApp | --proxy.redirectRootToApp | - | this switch enables a simple middleware that handles incoming requests to '/' by redirecting to a specific context. this is useful if your app is deployed under a long context and you want to shortcut the browser URL. |\n| proxy.cors | --proxy.cors | false | activates the CORS middleware that adds 'Access-Control-Allow-Origin: *' response headers to all responses |\n| proxy.proxyPassReverse | --proxy.proxyPassReverse | true | this enables the proxy pass reverse functionality. It handles the rewriting of target proxy URLs in responses (headers and body) back to origin local URLs |\n| proxy.proxies | - | - | this defines a list of proxy URLs that should result in a proxy request. Basically this is a list of [connect-proxy](https://github.com/drewzboto/grunt-connect-proxy) configuration objects with one addition: the attribute 'hostRewrite' will result in a dynamic replacement of the proxy request header attribute 'host' set to the local node servers host and port. |\n\nCommand line options overwrite any options from the package.json configuration. Example for providing command line options.\n```\ngrunt lite-proxyserver --proxy.port=4711 --proxy.https=true   \n```\n\nAn integration and configuration example of the [lite-proxyserver](https://github.com/msg-systems/lite-proxyserver) can be found in the [uica-skeleton](https://github.com/msg-systems/uica-skeleton).\n\n## License\n\nCode released under the [MIT license](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsg-systems%2Flite-proxyserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsg-systems%2Flite-proxyserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsg-systems%2Flite-proxyserver/lists"}