{"id":13991687,"url":"https://github.com/Adawg4/openapi-autospec","last_synced_at":"2025-07-22T14:31:41.103Z","repository":{"id":223613000,"uuid":"760891853","full_name":"Adawg4/openapi-autospec","owner":"Adawg4","description":"Proxy server that generates API specs for any app or website on localhost.","archived":false,"fork":false,"pushed_at":"2024-05-04T00:18:47.000Z","size":1756,"stargazers_count":633,"open_issues_count":0,"forks_count":16,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-21T02:49:04.486Z","etag":null,"topics":["api","apidoc-generator","devtools","documentation-generator","generator","openapi","openapi-specification","openapi3","proxy-server","specification"],"latest_commit_sha":null,"homepage":"http://portway.ai","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/Adawg4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2024-02-20T21:16:04.000Z","updated_at":"2024-11-20T08:13:51.000Z","dependencies_parsed_at":"2024-04-02T00:26:29.283Z","dependency_job_id":"84fa43f5-f93e-4f98-80a1-96e7662c3b98","html_url":"https://github.com/Adawg4/openapi-autospec","commit_stats":null,"previous_names":["adawg4/openapi-autospec"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adawg4%2Fopenapi-autospec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adawg4%2Fopenapi-autospec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adawg4%2Fopenapi-autospec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adawg4%2Fopenapi-autospec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Adawg4","download_url":"https://codeload.github.com/Adawg4/openapi-autospec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227123905,"owners_count":17734223,"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":["api","apidoc-generator","devtools","documentation-generator","generator","openapi","openapi-specification","openapi3","proxy-server","specification"],"created_at":"2024-08-09T14:01:31.677Z","updated_at":"2024-11-29T12:30:34.511Z","avatar_url":"https://github.com/Adawg4.png","language":"JavaScript","readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg height=\"120\" src=\"logo.png\"\u003e\n\n# OpenAPI AutoSpec\n\nNeed last-minute docs? Quickly capture API behavior with a server proxy that automatically generates OpenAPI specifications in real-time from any locally running website or service.\n\n\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue\" alt=\"license\"/\u003e [![Join Discord](https://img.shields.io/badge/Discord-Join-grey?style=flat\u0026logo=Discord)](https://discord.gg/CRnxg7uduH)\n\u003ca target=\"_blank\" href=\"https://twitter.com/intent/tweet?text=OpenAPI AutoSpec is a proxy server that generates API specs for any app or website on localhost! Try it out: https://github.com/adawg4/openapi-autospec\" class=\"item\"\u003e\u003cimg src=\"https://img.shields.io/twitter/url?label=Tweet\u0026amp;style=social\u0026amp;url=https://github.com/adawg4/openapi-autospec\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## About\n\u003cp align=\"center\" width=\"100%\"\u003e\n    \u003cimg width=\"80%\" src=\"autogif.gif\"\u003e\n\u003c/p\u003e\nOpenAPI AutoSpec is a local server proxy that generates new OpenAPI specifications from network requests. When running, it will connect your local HTTP traffic to the proxy. Once that happens, it will automatically convert network traffic into the specification.\n\n*Features*:\n- Generate OpenAPI 3.0 specifications automatically for any local website or application\n- Capture and document new requests \u0026 responses, including headers, bodies, and query parameters\n- Review generated specifications in real-time on your terminal and download them with ease\n- Export your OpenAPI file for sharing\n- Ignores static file URLs: .js, .css, .svg, .png, .jpeg, .ico.\n\u003c/br\u003e\n\n## Installation\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/).\n\nBefore installing, [download and install Node.js](https://nodejs.org/en/download/).\nNode.js 0.10 or higher is required.\n\nInstallation steps:\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```console\n$ npm install openapi-autospec\n```\n\u003c/br\u003e\n\n## Usage\nStart the server, it generates a link for you to use, and then use the new link from the proxy server to catch traffic on a target server. To generate the document you want: visit pages, fill out forms/all the fields or data you wish to track, and perform the actions you want to document from your APIs. For more information on getting documentation from a full-stack server versus both frontend and backend servers - \u003ca href=\"#readme-misc\"\u003euse this reference\u003c/a\u003e.\n\nTo start the server:\n```console\n$ npx autospec --portTo PORT --portFrom PORT --filePath openapi.json\n```\n\n- --portTo choose the port your localhost webserver is running from.\n- --portFrom (optional) is for if another port is in use.\n- --filePath is where you would like to export the spec.\n\n\u003c/br\u003e\nOnce the server is running, it will automatically begin documenting the API behavior of your local web applications. The documentation process is based on the network requests observed, so you don't need to do any crazy setup within your applications beyond the below.\n\n\nThe server provides real-time printouts of the generated OpenAPI specifications. From here:\n- Fill out all fields you wish to be documented for forms\n- Export the OpenAPI specification for external use or sharing (exports where you are in the terminal if you don't specify the --filePath flag)\n- You should find and replace all instances of ‘localhost’ or ‘127.0.0.1:8000’ in the exported doc with your actual website\n- Filter hosts and parameterize paths to fine-tune the documentation properly for server stubs\n- Restart the documentation process at any time to refresh the generated specifications\n\u003c/br\u003e\n\n## Roadmap\n\nWant an easy way to automatically build and manage your SDKs, Zapier/Make integrations, Docs, Webhooks, RPA plugins, and custom plugins to marketplaces like Salesforce, Zoom, GSuite all in one spot while getting your app AI-agent ready? [Contact us](https://calendly.com/aidan_/demo). We can custom tailor this and more with our paid service.\n\nAs for the repo:\n- [Path parameterization](https://www.abstractapi.com/api-glossary/path-parameters) tools\n- HTTPS and OpenAPI 3.1 Specification support\n- Run on GCP, AWS, Azure, Docker, and Kubernetes\n\u003c/br\u003e\n\n## What is OpenAPI?\nOpenAPI specifications provide a standardized description of an API's expected requests and responses, making APIs easier to understand and integrate with. Governed by the OpenAPI Initiative and the Linux Foundation, they are the modern standard for documenting RESTful APIs.\n\u003c/br\u003e\n\u003c/br\u003e\n\n## Community\n\n[Join our Discord!](https://discord.gg/CRnxg7uduH) We are here to answer questions and help you get the most out of our OpenAPI tool.\n\u003c/br\u003e\n\u003c/br\u003e\n\n## Contributing\n\nWe welcome community contributions. For guidelines, refer to our [CONTRIBUTING.md](/CONTRIBUTING.md).\n\n\n\nShoutouts to [Awesome API DevTools](https://github.com/yosriady/awesome-api-devtools) and [OpenAPI Devtools](https://chromewebstore.google.com/detail/openapi-devtools/jelghndoknklgabjgaeppjhommkkmdii).\n\u003c/br\u003e\n\n\n\u003ca name=\"readme-misc\"\u003e\u003c/a\u003e\n## Running proxies for multiple servers\n\n### Full-Stack Web Frameworks (e.g., Django)\n\n1. Run your website and note down the port and localhost information. Ex. 127.0.0.1:8000\n2. Run the script and specify the localhost information where traffic should be routed. Ex. npx autospec --portTo 8000. \n```\n$ npx autospec --portTo PORT --portFrom PORT--filePath openapi.json\n```\n- The --portTo flag should be followed by the localhost information where you want the traffic to be routed. Ex. \"127.0.0.1:8000\"\n- The optional --portFrom flag can be used to specify a different port to run the proxy, in case the default port is already in use. The value following this would be the port you want to use for the proxy. Ex. \"3000\" \n3. Copy the output URL (Ex. localhost:7928) and use your website or application as described above.\n4. Access the newly created file - named with the current timestamp.\n\n### Frontend and Backend Separately (e.g., a Node backend and React frontend)\n\nFor applications with a separate frontend and backend, run proxies for both.\n\n1. Run your frontend and note down the host and port information. E.g., 127.0.0.1:3000\n\n2. Operate your backend on a different port and note the host and port information. E.g., 127.0.0.1:5000 (For detailed guidelines on how to change port info, visit \u003ca href=\"#readme-bottom\"\u003ehere\u003c/a\u003e).\n\n3. Run the proxy for the frontend, specifying the frontend's host and port information where traffic should be routed. If necessary, you can specify a different port for the proxy to operate from.\n\n```console\n$ npx autospec --portTo FRONTEND_PORT --filePath frontend.json\n```\n\n4. Similarly, run the proxy for the backend, specifying the backend's host and port where the frontend normally sends information.\n\n```console\n$ npx autospec --portTo NEW_BACKEND_PORT --portFrom NORMAL_BACKEND_PORT --filePath backend.json\n```\n\nThis will initiate the server that listens to network requests from your locally running websites, automatically documenting their API interactions.\n\n## Changing backend ports\n\n\u003ca name=\"readme-bottom\"\u003e\u003c/a\u003e\n```markdown\n### 1. Express.js (Node.js)\nTo change the port for an Express.js application, you can set the port in your application code before starting the server. For example:\n\n```javascript\nconst express = require('express');\nconst app = express();\nconst port = 3001; // Change to your desired port\n\napp.listen(port, () =\u003e {\n  console.log(`Example app listening at http://localhost:${port}`);\n});\n```\n\n### 2. Django (Python)\nFor Django, you can specify the port when you run the runserver command from the command line:\n\n```shell\npython manage.py runserver 8080\n```\nThis command runs the server on port 8080.\n\n### 3. Flask (Python)\nIn Flask, you can specify the port when calling the app.run() method:\n\n```python\nfrom flask import Flask\napp = Flask(__name__)\n\nif __name__ == '__main__':\n    app.run(port=5001) // Change to your desired port\n```\n\n### 4. Rails (Ruby)\nFor a Rails application, you can specify the port with the -p option when starting the server:\n\n```shell\nrails server -p 4000\n```\nThis command runs the server on port 4000.\n\n### 5. Spring Boot (Java)\nIn Spring Boot, you can specify the server port in the application.properties or application.yml file located in the src/main/resources directory:\n\n```\nserver.port=8081\n```\n\n### 6. ASP.NET Core (C#)\nFor an ASP.NET Core application, you can specify the port in the launchSettings.json file found in the Properties folder of your project. Alternatively, you can use the --urls command-line argument:\n\n```shell\ndotnet run --urls=\"http://localhost:5002\"\n```\nThis command runs the server on port 5002.\n\n### 7. Laravel (PHP)\nIn Laravel, you can specify the port with the --port option when serving the application:\n\n```shell\nphp artisan serve --port=8001\n```\nThis command runs the server on port 8001.\n\n### 8. Vue.js (Node.js)\nFor a Vue.js project created with vue-cli, you can specify the port in the vue.config.js file:\n\n```javascript\nmodule.exports = {\n  devServer: {\n    port: 8081\n  }\n}\n```\n\n### 9. React (Node.js)\nFor a React application created with create-react-app, you can set the port by modifying the start script in your package.json file, or by setting the PORT environment variable before running the npm start command:\n\n```shell\nPORT=3001 npm start\n```\n\n### 10. Angular (Node.js)\nFor an Angular application, you can specify the port with the --port option when serving the application:\n\n```shell\nng serve --port 4201\n```\n\nThese are references - Always refer to the official documentation for the most accurate and up-to-date information.\n\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAdawg4%2Fopenapi-autospec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAdawg4%2Fopenapi-autospec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAdawg4%2Fopenapi-autospec/lists"}