##How to use
in main.js :
var require2 = require("cloud/require.js");
require2("cloud/app");
// same as
| node_modules | |
| .dockerignore | |
| Dockerfile | |
| npm-debug.log | |
| .git | |
| .hg | |
| .svn |
| # Dockerfile extending the google appengine Node image with application files for a | |
| # single application. | |
| FROM gcr.io/google_appengine/nodejs | |
| # Check to see if the the version included in the base runtime satisfies \ | |
| # ~0.12.0, if not then do an npm install of the latest available \ | |
| # version that satisfies it. \ | |
| RUN npm install https://storage.googleapis.com/gae_node_packages/semver.tar.gz && \ | |
| (node -e 'var semver = require("semver"); \ | |
| if (!semver.satisfies(process.version, "~0.12.0")) \ | |
| process.exit(1);' || \ |
| runtime: nodejs | |
| vm: true | |
| api_version: 1 | |
| env_variables: | |
| PORT: '8080' | |
| # The parsre configuration for parse-anywhere | |
| PARSE_APPLICATION_ID: PLACEHOLDER_FILL_ME | |
| PARSE_JAVASCRIPT_KEY: PLACEHOLDER_FILL_ME | |
| PARSE_MASTER_KEY: PLACEHOLDER_FILL_ME | |
| # optional |
| function isMobile() { | |
| var ua = navigator.userAgent.toLowerCase(); | |
| var isAndroid = ua.indexOf("android") > -1; | |
| var isiPhone = ua.indexOf("iphone") > -1; | |
| var isiPod = ua.indexOf("ipod") > -1; | |
| return (isAndroid || isiPhone || isiPod); | |
| } | |
| // In the callback | |
| if(isMobile()) { |
| web: node web.js | |
| worker: node worker.js |
| var self = this; | |
| var async = {}; | |
| // global on the server, window in the browser | |
| var root = this, | |
| previous_async = root.async; | |
| async.noConflict = function () { | |
| root.async = previous_async; | |
| return async; |
HOW TO USE
var Twitter = require("cloud/Twitter.parse.js");
// a user that has logged in with twitter
var user = Parse.User.current();
// Works with that object if colledted otherwise :)
var authData = {
| var FacebookAPI = function(app_id, app_secret) { | |
| return { | |
| auth_url : "https://graph.facebook.com/oauth/access_token?"+ | |
| "client_id=" + app_id + | |
| "&client_secret=" + app_secret + | |
| "&grant_type=client_credentials", | |
| setAppToken: function(app_token){ | |
| this.app_token = app_token; |