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
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
const fetch = require("node-fetch"); | |
const Parse = require("parse/node"); | |
const appId = "APPLICATION_ID"; | |
const restKey = "REST_KEY"; | |
const serverURL = "https://parseapi.back4app.com"; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
<script> |
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 storageRef = firebase.storage.ref("folderName/file.jpg"); | |
var fileUpload = document.getElementById("fileUpload"); | |
fileUpload.on('change', function(evt) { | |
var firstFile = evt.target.file[0]; | |
var uploadTask = storageRef.put(firstFile); |
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 storageRef = firebase.storage.ref("folderName/file.jpg"); | |
var fileUpload = document.getElementById("fileUpload"); | |
fileUpload.on('change', function(evt) { | |
var firstFile = evt.target.file[0]; | |
var uploadTask = storageRef.put(firstFile); |
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 express = require('express'); | |
var app = express(); | |
var port =process.env.PORT || 3000; | |
var routes = require('./api/routes'); routes(app); | |
app.listen(port,function(){ console.log('Server started on port: ' + port); }); |
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
'use strict'; | |
var controller = require('./controller'); | |
module.exports = function(app) { | |
app.route('/about') | |
.get(controller.about); |
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
'use strict'; | |
var properties = required('../package.json'); | |
var distance = require('../service/distance'); | |
var controllers = { | |
about: function(req,res){ | |
var aboutInfo = { name:properties.name, version: properties.version } | |
res.json(aboutInfo); | |
}, | |
get_distance: function(req, res){ |
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 request = require('request'); | |
const apiKey = process.env.ZIPCODE_API_KEY || "hkCt1nW1wF1rppaEmoor7T9G4ta7R5wFSu8l1dokNz8y53gGZHDneWWVosbEYirC"; | |
const zipCodeURL = 'https://www.zipcodeapi.com/rest/'; | |
var distance = { | |
find: function(req, res, next) { |
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
Incognia.getInstallationId(context) { result -> | |
if (result.isSuccessful) { | |
val installationId = result.result | |
// HttpURLConnection | |
httpUrlConnection.setRequestProperty("Incognia-Installation-ID", installationId) | |
} | |
// Send the request with the installationId to your backend server | |
} |
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
Incognia.getInstallationId(context, new IncogniaListener<String>() { | |
@Override | |
public void onResult(final Result<String> result) { | |
if (result.isSuccessful()) { | |
String installationId = result.getResult(); | |
// HttpURLConnection | |
httpUrlConnection.setRequestProperty("Incognia-Installation-ID", installationId); | |
} |
OlderNewer