{"id":18374475,"url":"https://github.com/recruit-tech/agreed","last_synced_at":"2025-05-15T15:07:11.938Z","repository":{"id":10217694,"uuid":"65002261","full_name":"recruit-tech/agreed","owner":"recruit-tech","description":"agreed is Consumer Driven Contract tool with JSON mock server.","archived":false,"fork":false,"pushed_at":"2025-03-28T15:00:21.000Z","size":17193,"stargazers_count":215,"open_issues_count":17,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-07T21:09:46.054Z","etag":null,"topics":["mock-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/recruit-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-08-05T08:26:42.000Z","updated_at":"2024-12-21T01:36:33.000Z","dependencies_parsed_at":"2023-10-23T15:01:59.678Z","dependency_job_id":"b5685d3f-3b98-4fa9-98d7-01fd012372d1","html_url":"https://github.com/recruit-tech/agreed","commit_stats":{"total_commits":528,"total_committers":19,"mean_commits":"27.789473684210527","dds":0.4337121212121212,"last_synced_commit":"ceaed244778d10996d53201e343a2be1a066063a"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recruit-tech%2Fagreed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recruit-tech%2Fagreed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recruit-tech%2Fagreed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recruit-tech%2Fagreed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/recruit-tech","download_url":"https://codeload.github.com/recruit-tech/agreed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254364270,"owners_count":22058878,"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":["mock-server"],"created_at":"2024-11-06T00:14:46.611Z","updated_at":"2025-05-15T15:07:06.928Z","avatar_url":"https://github.com/recruit-tech.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# \u003cimg src=\"https://recruit-tech.github.io/agreed/media/logo-with-text.svg\" width=\"300\" /\u003e\n\n![Node.js CI](https://github.com/recruit-tech/agreed/workflows/Node.js%20CI/badge.svg)\n\nagreed is Consumer Driven Contract tool with JSON mock server.\n\nagreed has 3 features.\n\n1. Create contract file as json(json5/yaml/etc) file\n1. mock server for frontend development\n1. test client for backend development\n\n# Install\n\n```\n$ npm install @agreed/cli -g\n```\n\n# Usage\n\n## Usage as Frontend Mock Server\n\n- Create agreed file (this file is used as a contract between frontend and backend)\n\n```javascript\n// save as agreed.js\nmodule.exports = [\n  {\n    request: {\n      path: '/user/:id',\n      method: 'GET',\n      query: {\n        q: '{:someQueryStrings}',\n      },\n      values: {\n        id: 'yosuke',\n        someQueryStrings: 'foo'\n      },\n    },\n    response: {\n      headers: {\n        'x-csrf-token': 'csrf-token', \n      },\n      body: {\n        message: '{:greeting} {:id} {:someQueryStrings}',\n        images: '{:images}',\n        themes: '{:themes}',\n      },\n      values: {\n        greeting: 'hello',\n        images: [\n          'http://example.com/foo.jpg',\n          'http://example.com/bar.jpg',\n        ],\n        themes: {\n          name: 'green',\n        },\n      }\n    },\n  },\n]\n```\n\n- Run server\n\n```\n$ agreed-server --path ./agreed.js --port 3010\n```\n\n- curl to the mock server\n\n```\n$ curl http://localhost:3010/user/yosuke?q=foo\n{\n  \"message\": \"hello yosuke foo\",\n  \"images\": [\n    \"http://example.com/foo.jpg\",\n    \"http://example.com/bar.jpg\"\n  ],\n  \"themes\": {\n    \"name\": \"green\"\n  }\n}\n```\n\n## Usage as Backend test client\n\n- Run test client for confirm response\n\n```\n$ agreed-client --path ./agreed.js --port 3030 --host example.com\n```\n\n## Usage: Agreed Documentation\n\n- Run documentation server\n\n```\n$ agreed-ui --path ./agreed.js --port 3031\n```\n\n![ScreenShot](https://raw.githubusercontent.com/recruit-tech/agreed-ui/master/screenshot.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecruit-tech%2Fagreed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecruit-tech%2Fagreed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecruit-tech%2Fagreed/lists"}