UNPKG

portpilot

Version:

Map local dev ports to custom domains easily

136 lines (98 loc) โ€ข 2.91 kB
# ๐Ÿš€ PortPilot Pilot your ports like domains, effortlessly map your local apps to custom domains โ€” no admin headaches, no messy proxy setups. **Powered by nginx under the hood.** One config file. Multiple apps. Zero chaos. [![npm version](https://img.shields.io/npm/v/portpilot.svg)](https://www.npmjs.com/package/portpilot) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE) ๐ŸŒ [portpilot.js.org](https://portpilot.js.org) --- ## โœจ Why PortPilot? - โšก Instantly map `myapp.local` to your running apps - ๐Ÿง  No more editing the `hosts` file โ€” handled automatically - ๐Ÿ–ฅ๏ธ Nginx-powered proxy setup (auto-installed if missing) - ๐Ÿ› ๏ธ Supports per-app custom nginx configs - ๐Ÿงน Smart cleanup on stop: hosts, configs, rules - ๐Ÿ“ฆ Lightweight, fast, and made for developers --- ## ๐Ÿ“ฆ Installation ```bash # As a dev dependency pnpm add -D portpilot # Or install globally pnpm add -g portpilot ``` Compatible with `npm`, `yarn`, or `pnpm`. --- ## โš™๏ธ Configuration โ€” `.pilotrc.json` Create a `.pilotrc.json` in your project root: ```json { "apps": [ { "domain": "test1.local", "port": 1010, "https": false, "customAppConfig": { "enabled": true, "path": "./conf/conf.nginx" } }, { "domain": "test2.local", "port": 2020, "https": false }, { "domain": "test3.local", "port": 3030, "https": false } ], "on": { "stop": { "cleanNginx": true, "cleanHosts": true, "cleanConfigs": true } } } ``` ๐Ÿ’ก Add as many apps as you want โ€” no limits. --- ## ๐Ÿš€ Get Started ```bash # Start mapping domains npx portpilot start # Or if installed globally portpilot start ``` ๐Ÿ›‘ To stop and clean everything up: ```bash portpilot stop ``` --- ## ๐Ÿ”ง Advanced Usage: Custom Nginx Configs Need full control? You can provide your own nginx block per app via the `customAppConfig.path` key. When enabled, your config will override the default generated one. --- ## ๐Ÿ›ฃ๏ธ Roadmap - โœ… Host file automation - โœ… Nginx-based reverse proxy - โœ… Multi-app support - โœ… Per-app custom nginx configs - โณ HTTPS + auto-cert generation - โณ Global nginx config support - โณ Live reload on config change --- ## ๐Ÿ“‹ Requirements - Node.js 20+ - Admin access (`sudo` on macOS/Linux, auto prompt on Windows) - Some experience with local development --- ## ๐Ÿ“„ License MIT ยฉ [Abhinav Prakash](https://github.com/rishiyaduwanshi) --- ## ๐Ÿ™Œ Support & Feedback - ๐Ÿ› [Report issues](https://github.com/rishiyaduwanshi/portpilot/issues) - ๐ŸŒŸ Star this repo if it helped you! - ๐Ÿ’Œ [contact@rishiyaduwanshi.me](mailto:contact@rishiyaduwanshi.me)