{"id":19370167,"url":"https://github.com/phonegap/connect-phonegap","last_synced_at":"2025-08-16T15:05:12.032Z","repository":{"id":12408951,"uuid":"15062671","full_name":"phonegap/connect-phonegap","owner":"phonegap","description":"Stream a PhoneGap app to any device.","archived":false,"fork":false,"pushed_at":"2022-12-08T08:07:00.000Z","size":7714,"stargazers_count":61,"open_issues_count":32,"forks_count":60,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-31T09:07:47.509Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phonegap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-10T00:06:46.000Z","updated_at":"2024-05-01T07:02:23.000Z","dependencies_parsed_at":"2023-01-13T16:56:15.506Z","dependency_job_id":null,"html_url":"https://github.com/phonegap/connect-phonegap","commit_stats":null,"previous_names":["phonegap/node-phonegap-soundwave"],"tags_count":81,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fconnect-phonegap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fconnect-phonegap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fconnect-phonegap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fconnect-phonegap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phonegap","download_url":"https://codeload.github.com/phonegap/connect-phonegap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271480,"owners_count":20911586,"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":[],"created_at":"2024-11-10T08:14:24.433Z","updated_at":"2025-04-07T11:07:37.212Z","avatar_url":"https://github.com/phonegap.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# connect-phonegap \n[![Build Status][travis-ci-img]][travis-ci-url] \n[![codecov](https://codecov.io/gh/phonegap/connect-phonegap/branch/master/graph/badge.svg)](https://codecov.io/gh/phonegap/connect-phonegap)\n\n\u003e Connect middleware to serve a PhoneGap app.\n\n## What is it?\n\n  A fine question for an even finer middleware. `connect-phonegap` is a server that runs on your development machine (typically through the `phonegap-cli`) and serves your PhoneGap app to the accompanying PhoneGap Developer App. `connect-phonegap` does this by watching your PhoneGap project and first sends a zip of the www/ to your app. When you update your project, the differences are then sent to your connected phone to display updates.\n\n  To note: when the server sends content to your phone, the server is also injecting js inline into the .html pages. The injected scripts are for detecting changes on the server, logging, handling three/four finger taps, etc. Sometimes this may interfere with your own js code that you may write. Therefore, we have options in order to toggle these scripts.\n\n\n## Examples\n\n### Standalone\n\n    var pgConnect = require('connect-phonegap');\n    pgConnect.listen();\n\n### Express\n\n    var pgConnect = require('connect-phonegap'),\n        express = require('express'),\n        app = express();\n\n    app.use(pgConnect());\n    app.listen(3000);\n\n### Connect\n\n    var pgConnect = require('connect-phonegap'),\n        connect = require('connect'),\n        app = connect();\n\n    app.use(pgConnect());\n    app.listen(3000);\n\n### HTTP\n\n    var pgConnect = require('connect-phonegap'),\n        http = require('http');\n\n    var server = http.createServer(pgConnect());\n    server.listen(3000);\n\n## API\n\n    var pgConnect = require('connect-phonegap');\n\n### pgConnect()\n\nOptions:\n\n  - `[options]` {Object}\n  - `[autoreload]` {Boolean} toggle AutoReload watch (default: true).\n  - `[localtunnel]` {Boolean} toggle localtunnel (default: false).\n  - `[console]` {Boolean} toggle console logging injection script - allows logs to be appears on your terminal(default: true).\n  - `[deploy]` {Boolean} toggle deploy injection script - allows zips to be unzipped and deployed when sent to the client (default: true).\n  - `[homepage]` {Boolean} toggle homepage injection script - allows the ability to three finger tap back to the landing page of the PhoneGap Developer App (default: true).\n  - `[proxy]` {Boolean} toggle proxy injection script - for previewing the app from browser. Allows cors requests to be proxy'd through the server (default: true).\n  - `[push]` {Boolean} toggle push injection script - allows push notifications to be used within the PhoneGap Developer App (default: true).\n  - `[refresh]` {Boolean} toggle refresh injection script - allows four finger tap to hard refresh your app (default: true).\n\nEvents:\n\n  - `error` is emitted when an error occurs.\n  - `log` is emitted with log info.\n  - `deviceConnected` is emitted whenever a new device connects to the server.\n\nReturn:\n\n  - {Function} request listener that can be provided to `http.Server` or\n    used as `connect` middleware.\n\nExample:\n\n    var pgConnect = require('connect-phonegap')(),\n        middleware = pgConnect();\n\n    // subscribe to events\n    middleware.on('log', function() {\n        console.log.apply(this, arguments);\n    });\n\n    // use as middleware\n    app.use(middleware);\n\n    // or\n\n    // use as request listener\n    http.createServer(middleware).listen(3000);\n\n### pgConnect.listen(options, [callback])\n### pgConnect.serve(options, [callback])\n\nCreates a local server to serve up the project. The intended\nreceiver is the PhoneGap App but any browser can consume the\ncontent.\n\nOptions:\n\n  - `[options]`\n    - `[port]` {Number} to listen on (Default: 3000).\n    - all options available to phonegap() middleware.\n\nEvents:\n\n  - `complete` is triggered when server starts.\n    - `data` {Object}\n      - `server` {http.Server} is the server running.\n      - `address` {String} is the server address.\n      - `port` {Number} is the server port.\n  - `error` trigger when there is an error with the server or request.\n    - `e` {Error} is null unless there is an error.\n  - all events available to phonegap() middleware.\n  - all events available to `http.Server`\n\nReturn:\n\n  - {http.Server} instance that is also an event emitter.\n\nExample:\n\n    pgConnect.listen()\n            .on('complete', function(data) {\n                // server is now running\n            })\n            .on('error', function(e) {\n                // an error occured\n            });\n    });\n\n[travis-ci-img]: https://travis-ci.org/phonegap/connect-phonegap.svg?branch=master\n[travis-ci-url]: http://travis-ci.org/phonegap/connect-phonegap\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphonegap%2Fconnect-phonegap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphonegap%2Fconnect-phonegap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphonegap%2Fconnect-phonegap/lists"}