Skip to content

Commit ed2d93a

Browse files
author
Nicolas Garnier
committed
Added local testing instructions for HTTPS triggers with hosting integration.
Change-Id: I545cc1758d8205f891bd8d67885b6cf6f60fafe5
1 parent a122f19 commit ed2d93a

File tree

7 files changed

+54
-11
lines changed

7 files changed

+54
-11
lines changed

authenticated-json-api/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,20 @@ detected by the [Cloud Natural Language API](https://cloud.google.com/natural-la
1919
1. You must have the Firebase CLI installed. If you don't have it install it with `npm install -g firebase-tools` and then configure it with `firebase login`.
2020
1. Configure the CLI locally by using `firebase use --add` and select your project in the list.
2121
1. Install dependencies locally by running: `cd functions; npm install; cd -`
22-
1. Enable the Google Cloud Natural Language API: https://console.cloud.google.com/apis/api/language.googleapis.com/overview?project=_
22+
1. [Enable the Google Cloud Natural Language API](https://console.cloud.google.com/apis/api/language.googleapis.com/overview?project=_)
2323

2424
## Deploy and test
2525

26-
This sample comes with a web-based UI for testing the function. To test it out:
26+
This sample comes with a web-based UI for testing the function.
27+
To test locally do:
28+
29+
1. Start serving your project locally using `firebase serve --only hosting,functions`
30+
1. Open the app in a browser at `https://localhost:5000`.
31+
1. Sign in to the web app in the browser using Google Sign-In
32+
1. Create messages and explore them using the List and Detail sections.
33+
1. Sign out. You should no longer be able to access the API.
34+
35+
To deploy and test on prod do:
2736

2837
1. Deploy your project using `firebase deploy`
2938
1. Open the app using `firebase open hosting:site`, this will open a browser.

authenticated-json-api/functions/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ const categorizeScore = score => {
120120
return 'positive';
121121
} else if (score < -0.25) {
122122
return 'negative';
123-
} else {
124-
return 'neutral';
125123
}
126-
}
124+
return 'neutral';
125+
};

authorized-https-endpoint/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ This sample comes with a simple web-based UI which code is in [public](public) d
2323

2424
## Deploy and test
2525

26-
This sample comes with a web-based UI for testing the function. To test it out:
26+
This sample comes with a web-based UI for testing the function.
27+
To test locally do:
28+
29+
1. Start serving your project locally using `firebase serve --only hosting,functions`
30+
1. Open the app in a browser at `https://localhost:5000`.
31+
1. Sign in the web app in the browser using Google Sign-In and two authenticated requests will be performed from the client and the result will be displayed on the page, normally "Hello <user displayname>".
32+
33+
34+
To deploy and test on prod do:
2735

2836
1. Deploy your project using `firebase deploy`
2937
1. Open the app using `firebase open hosting:site`, this will open a browser.

image-maker/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ It uses [node-canvas](https://github.com/Automattic/node-canvas) to create a can
1515

1616
## Deploy and test
1717

18-
This sample comes with a web-based UI for testing the function. To test it out:
18+
This sample comes with a web-based UI for testing the function.
19+
To test locally do:
20+
21+
1. Start serving your project locally using `firebase serve --only hosting,functions`
22+
1. Open the app in a browser at `https://localhost:5000`.
23+
24+
To deploy and test on prod do:
1925

2026
1. Deploy your project using `firebase deploy`
21-
1. Open the app using `firebase open hosting:site`, this will open a browser.`
27+
1. Open the app using `firebase open hosting:site`, this will open a browser.
2228

2329

2430
## Contributing

isomorphic-react-app/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ The `src` folder contains the source code for React app. It also uses [Webpack](
2222

2323
## Deploy and test
2424

25-
This sample comes with a web-based UI for testing the function. To test it out:
25+
This sample comes with a web-based UI for testing the function.
26+
To test locally do:
27+
28+
1. Start serving your project locally using `firebase serve --only hosting,functions`
29+
1. Open the app in a browser at `https://localhost:5000`.
30+
31+
To test it out:
2632

2733
1. Deploy your project using `firebase deploy`
2834
1. Open the app using `firebase open hosting:site`, this will open a browser.

quickstarts/big-ben/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ npm install -g firebase-tools
3636

3737
> Doesn't work? You may need to [change npm permissions](https://docs.npmjs.com/getting-started/fixing-npm-permissions).
3838
39+
## Try the sample locally
40+
41+
Start serving your project locally using `firebase serve --only hosting,functions`
42+
43+
Open the app in a browser at `https://localhost:5000/bigben`.
44+
45+
A page containing a repeated number of "BONG" will be displayed.
46+
3947

4048
## Deploy the app to prod
4149

@@ -58,7 +66,7 @@ This deploys and activates the `reverseString` Function.
5866
> The first time you call `firebase deploy` on a new project with Functions will take longer than usual.
5967
6068

61-
## Try the sample
69+
## Try the sample on prod
6270

6371
After deploying the function you can open the following URL in your browser:
6472

template-handlebars/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ Some custom scripts in [functions/views/layouts/main.handlebars] maintain the Fi
2121

2222
## Deploy and test
2323

24-
This sample comes with a web-based UI for testing the function. To test it out:
24+
This sample comes with a web-based UI for testing the function.
25+
To test locally do:
26+
27+
1. Start serving your project locally using `firebase serve --only hosting,functions`
28+
1. Open the app in a browser at `https://localhost:5000`.
29+
1. Sign in the web app in the browser using Google Sign-In and some user information will be displayed on a server-side generated page.
30+
31+
To deploy and test the app on prod do:
2532

2633
1. Deploy your project using `firebase deploy`
2734
1. Open the app using `firebase open hosting:site`, this will open a browser.

0 commit comments

Comments
 (0)