{"id":16959165,"url":"https://github.com/wewoor/cup","last_synced_at":"2025-07-02T16:34:23.178Z","repository":{"id":57297560,"uuid":"70450709","full_name":"wewoor/cup","owner":"wewoor","description":"Easy to serve web resources, Easy to proxy requests.","archived":false,"fork":false,"pushed_at":"2022-06-16T11:12:09.000Z","size":129,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T22:08:36.581Z","etag":null,"topics":["cli","expressjs","nginx","node","proxy","server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wewoor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-10T04:01:50.000Z","updated_at":"2023-09-15T08:50:00.000Z","dependencies_parsed_at":"2022-09-02T05:42:03.179Z","dependency_job_id":null,"html_url":"https://github.com/wewoor/cup","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wewoor%2Fcup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wewoor%2Fcup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wewoor%2Fcup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wewoor%2Fcup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wewoor","download_url":"https://codeload.github.com/wewoor/cup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487712,"owners_count":21112191,"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":["cli","expressjs","nginx","node","proxy","server"],"created_at":"2024-10-13T22:44:25.885Z","updated_at":"2025-04-11T22:08:43.297Z","avatar_url":"https://github.com/wewoor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cup\n\n[![NPM downloads][download-img]][download-url] [![NPM version][npm-version]][npm-version-url]\n\n**Easy to serve web resources, and proxy requests**. You can use the `Cup` to mock a web server like the `Nginx` for your static resource sometimes.\n\n[download-img]: https://img.shields.io/npm/dm/mini-cup.svg?style=flat\n[download-url]: https://www.npmjs.com/package/mini-cup\n[npm-version]: https://img.shields.io/npm/v/mini-cup.svg?style=flat-square\n[npm-version-url]: https://www.npmjs.com/package/@dtinsight/molecule\n\n[中文文档](./README_zh.md)  | [English](./README.md)\n\n## Installation\n\n```bash\n$ npm install -g mini-cup\n\nOr\n\n$ yarn add -g mini-cup\n```\n\n## Usage\n\n### Run the server by the specified path\n\n```bash\n$ cup run \u003cpath\u003e //The path is your indicated directory\n```\n\n### Run the server by the specified path and port\n\n```bash\n$ cup run \u003cpath\u003e -p \u003cport\u003e\n```\n\n### Run by `cup.config.js` config mode\n\nRun the server by the custom configuration. There you can initialize a `cup.config.js` file in the current working directory.\n\n```bash\n$ cup init\n```\n\nAnd run the start command:\n\n```bash\n$ cup run -c\n```\n\n#### The example of `cup.config.js`\n\n```js\nconst base = './dist'\nmodule.exports = {\n    name: 'example',\n    listen: 3000,\n    root: base,\n    location: {\n        '/api/task/get': `${base}/get.json`,\n        '/api/task/add': `${base}/add.json`\n    },\n    proxyTable: {\n        '/join': {\n            target: 'https://github.com',\n            changeOrigin: true\n        }\n    }\n}\n```\n\n## Proxy\n\nMore usage of Proxy, please refer to [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwewoor%2Fcup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwewoor%2Fcup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwewoor%2Fcup/lists"}