Created
August 12, 2017 06:26
-
-
Save nhathiwala/3de25ef3f20ebdc9274a2db2172aa006 to your computer and use it in GitHub Desktop.
firefunctions/src/api/index.ts
This file contains hidden or 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
/* | |
* FILE NAME: index.ts | |
* FILE PATH: './api/' | |
* AUTHOR: NAYAN HATHIWALA | |
* CREATED ON: 10/8/2017 | |
* DESCRIPTION: BASE API. | |
*/ | |
/* | |
* IMPORT LIBRARY HERE | |
*/ | |
import * as functions from 'firebase-functions' | |
import { validateFireTokenId } from '../lib' | |
import * as express from 'express' | |
import { SubApi } from './sub-api/sub' | |
import { Authn } from './sub-api/authn' | |
/* | |
* Initiating Express Router | |
*/ | |
const api = express.Router(); | |
/* | |
* All API Base Functions goes below. | |
* ----------------------------------- | |
* You can add as many sub-routes as you want, by just | |
* defining express and initiating with express router | |
*/ | |
api.get('/', function (req, res) { | |
res.send('Hello World! root route.'); | |
}); | |
api.use('/sub', SubApi); | |
api.use('/authenticated', Authn); | |
export const ApiBase = api |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment