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
#!/bin/sh | |
# NOTE: This file is modified version taken from: | |
# https://github.com/amardeshbd/medium-api-specification/blob/master/api-spec_validation_test.sh | |
# Tests the swagger specificaton using online service | |
testOpenApiSpecValidity() { | |
expectedOutput="{}" | |
expectedOutputSize=${#expectedOutput} | |
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
language: bash | |
before_script: | |
# Load the shUnit2 for running shell-script unit test | |
- curl -L "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/shunit2/shunit2-2.1.6.tgz" | tar zx | |
script: | |
# Get proper branch name based on http://graysonkoonce.com/getting-the-current-branch-name-during-a-pull-request-in-travis-ci/ | |
- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST | |
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi) |
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
productFlavors { | |
dev { | |
// To avoid using legacy multidex, set minSdkVersion to 21 or higher. | |
minSdkVersion 21 | |
// The following configuration limits the "dev" flavor to using | |
// English string resources and xxhdpi screen-density resources. | |
resConfigs "en", "xxxhdpi" |
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
firebase list |
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
firebase init |
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
firebase use --add your-project-id-23d6x |
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
cd functions | |
npm install | |
cd .. |
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
'use strict'; | |
// [START import] | |
const functions = require('firebase-functions'); | |
const express = require('express'); | |
const app = express(); | |
// [END import] | |
// [START middleware] | |
const cors = require('cors')({origin: true}); |
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
/** | |
* Say hello API | |
* Try: https://mock-apis-server.firebaseapp.com/say/hello | |
*/ | |
app.get('/say/hello', (req, res) => { | |
// Return success response | |
return res.status(200).json({"message":"Hello there... Welcome to mock server."}); | |
}); | |
/* [END `/say/hello` ] - must be added before `exports.api = ...` */ |