Preview docs using localhost instead of 127.0.0.1
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 228
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 48
Description
Describe the bug
When running a web server via WSL only localhost works, 127.0.0.1 does not reach the ports opened by WSL apps. The link generated by preview-docs uses http://127.0.0.1:8080 but for WSL users this should be http://localhost:8080.
To Reproduce
Run openapi preview-docs via Node installed on Windows Subsystem for Linux and click the link: ERR_CONNECTION_REFUSED
Expected behavior
Clicking the link provided by the CLI opens the docs successfully.
openapi-cli Version(s)
1.0.0-beta-69
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the preview-docs command and locate where the CLI generates the local documentation URL. Change the generated host from 127.0.0.1 to localhost, then run the preview-docs flow under WSL and confirm the link opens the docs successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100