Skip to content

Instantly share code, notes, and snippets.

@nhathiwala
Last active August 12, 2017 05:52
Show Gist options
  • Save nhathiwala/aafa4703ff82cfa97b2ba41426b1931c to your computer and use it in GitHub Desktop.
Save nhathiwala/aafa4703ff82cfa97b2ba41426b1931c to your computer and use it in GitHub Desktop.
firefunctions/src/lib/index.ts
/*
* FILE NAME: index.ts
* FILE PATH: './lib/'
* AUTHOR: NAYAN HATHIWALA
* CREATED ON: 10/8/2017
* DESCRIPTION: All necessary library initialization are to be done in this file.
*/
// IMPORT LIBRARY HERE
const googleCloudDatastore = require('@google-cloud/datastore')({
projectId: 'you-project-id',
keyFilename: './gcloud-keyfile.json'
});
/*
* Validate Firebase Token ID via `HEADER` or `COOKIE`
* Source: https://github.com/firebase/functions-samples/blob/master/authorized-https-endpoint/functions/index.js
*/
export const validateFireTokenId = (req: any , res: any, next: any) => {
...
}
/*
* MAKE YOUR LIBARAY INITIALIZED EXPORT HERE
*/
export const datastore = googleCloudDatastore;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment