{"id":28447580,"url":"https://github.com/rubensflinco/json-to-mock-api","last_synced_at":"2026-05-09T19:36:39.019Z","repository":{"id":296703694,"uuid":"994212116","full_name":"rubensflinco/json-to-mock-api","owner":"rubensflinco","description":"Uma biblioteca CLI para criar servidores REST API a partir de arquivos JSON","archived":false,"fork":false,"pushed_at":"2026-03-02T14:18:29.000Z","size":627,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-02T17:48:10.731Z","etag":null,"topics":["api","cli","express","json","json-server","json-to-mock-api","mock-server","rest-api","swagger"],"latest_commit_sha":null,"homepage":"https://json-to-mock-api.fdoma.in","language":"TypeScript","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/rubensflinco.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-01T13:14:36.000Z","updated_at":"2026-03-02T14:17:22.000Z","dependencies_parsed_at":"2025-06-02T10:51:29.348Z","dependency_job_id":null,"html_url":"https://github.com/rubensflinco/json-to-mock-api","commit_stats":null,"previous_names":["rubensflinco/json-server-plus","rubensflinco/json-to-mock-api"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/rubensflinco/json-to-mock-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubensflinco%2Fjson-to-mock-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubensflinco%2Fjson-to-mock-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubensflinco%2Fjson-to-mock-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubensflinco%2Fjson-to-mock-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubensflinco","download_url":"https://codeload.github.com/rubensflinco/json-to-mock-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubensflinco%2Fjson-to-mock-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32833373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"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":["api","cli","express","json","json-server","json-to-mock-api","mock-server","rest-api","swagger"],"created_at":"2025-06-06T12:06:05.177Z","updated_at":"2026-05-09T19:36:39.013Z","avatar_url":"https://github.com/rubensflinco.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Json-To-Mock-Api\n\nA simple CLI library to create REST servers from JSON files or folders with multiple JSON files, featuring **automatic integrated Swagger documentation**.\n\n[![NPM Version](https://img.shields.io/npm/v/json-to-mock-api.svg)](https://www.npmjs.com/package/json-to-mock-api)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/rubensflinco/json-to-mock-api/blob/main/LICENSE)\n[![GitHub](https://img.shields.io/github/stars/rubensflinco/json-to-mock-api?style=social)](https://github.com/rubensflinco/json-to-mock-api)\n\n## ✨ Features\n\n- 📋 **Automatic Swagger Documentation**: Interactive interface to test and document APIs\n- 🔧 **Mocked Headers**: Support for custom response headers for realistic simulations\n- 🍪 **Mocked Cookies**: Support for custom response cookies with advanced options\n- 🔄 **Inline Schemas**: Automatically generated schemas based on real data\n- 🚀 **Multiple HTTP Methods**: Support for GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD\n- 📁 **File or Folder Mode**: Load multiple JSON files or single file\n- 🌐 **CORS Enabled**: Ready for web applications\n- 🔗 **Path Parameters**: Automatic support for parameters like `:id`, `:userId`, etc.\n- 🏷️ **Smart Grouping**: Endpoints grouped by folder or file origin\n\n## Installation\n\n```bash\n# Global installation\nnpm install -g json-to-mock-api\n\n# Or use directly with npx\nnpx --yes json-to-mock-api\n```\n\n## Quick Start\n\n### 1. Create a JSON file called `db.json`:\n\n```json\n{\n  \"endpoints\": {\n    \"users\": {\n      \"GET\": {\n        \"body\": [\n          { \"id\": 1, \"name\": \"John Doe\", \"email\": \"john@email.com\" },\n          { \"id\": 2, \"name\": \"Jane Smith\", \"email\": \"jane@email.com\" }\n        ],\n        \"headers\": {\n          \"X-Total-Count\": \"2\"\n        },\n        \"cookies\": {\n          \"session\": \"abc123\"\n        }\n      },\n      \"POST\": {\n        \"body\": { \"id\": 3, \"name\": \"New User\", \"email\": \"new@email.com\" }\n      }\n    },\n    \"users/:id\": {\n      \"GET\": {\n        \"body\": { \"id\": 1, \"name\": \"John Doe\", \"email\": \"john@email.com\" }\n      }\n    }\n  }\n}\n```\n\n### 2. Run the command:\n\n```bash\nnpx --yes json-to-mock-api -f db.json\n```\n\n### 3. Access:\n\n- **Swagger UI**: `http://localhost:3000/` (Interactive documentation)\n- **API Endpoint**: `http://localhost:3000/users`\n- **OpenAPI Spec**: `http://localhost:3000/swagger.json`\n\n## Usage Modes\n\n### File Mode\n```bash\njson-to-mock-api -f db.json\n```\n\n### Folder Mode\n```bash\njson-to-mock-api -d ./data\n```\n\n## CLI Options\n\n- `-f, --file \u003cpath\u003e`: Path to JSON file\n- `-d, --directory \u003cpath\u003e`: Path to folder with JSON files  \n- `-p, --port \u003cnumber\u003e`: Server port (default: 3000)\n- `-h, --host \u003cstring\u003e`: Server host (default: localhost)\n\n## 📚 Complete Documentation\n\nFor detailed documentation, advanced features, examples, and guides, visit:\n\n**[Official Documentation →](https://jsont-to-mock-api.fdoma.in/)**\n\nThe documentation includes:\n- Complete setup guides\n- Folder mode examples\n- Advanced JSON structures\n- Headers and cookies configuration\n- Path parameters usage\n- Multiple file organization strategies\n- Best practices and tips\n\n## License\n\nMIT\n\n---\n\n**[📖 Read the Full Documentation](https://jsont-to-mock-api.fdoma.in/)** | **[🐛 Report Issues](https://github.com/rubensflinco/json-to-mock-api/issues)** | **[💬 Discussions](https://github.com/rubensflinco/json-to-mock-api/discussions)** ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubensflinco%2Fjson-to-mock-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubensflinco%2Fjson-to-mock-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubensflinco%2Fjson-to-mock-api/lists"}