Last active
April 24, 2016 20:47
-
-
Save devgeeks/18d74ac48e7d48d45596f6feee16f742 to your computer and use it in GitHub Desktop.
Serve Star Track via phonegap.serve() on Heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- for heroku, replace the CSP in Star Track with this --> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com https://api.spotify.com http://*.herokuapp.com 'unsafe-eval' 'unsafe-inline' ws://*.herokuapp.com ws://localhost:3000; style-src 'self' 'unsafe-inline'; media-src *; img-src * data:"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var phonegap = require('phonegap'); | |
phonegap.serve({ | |
port: process.env.PORT || 3000, // optional | |
autoreload: true, // optional | |
localtunnel: false, // optional (no point with Heroku) | |
browser: true | |
}, function(e) { | |
console.log((e) ? e.message : 'server is running'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "startrack-heroku", | |
"description": "PhoneGap Star Track App hosted on Heroku", | |
"version": "0.0.1", | |
"main": "./index.js", | |
"scripts": { | |
"start": "node ./index.js" | |
}, | |
"engines": { | |
"node": ">=0.10.0", | |
"npm": ">=1.2.0" | |
}, | |
"dependencies": { | |
"phonegap": "^6.1.0" | |
}, | |
"devDependencies": {}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: npm start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment