Skip to content

Commit 31b6f65

Browse files
committed
feat: Add basic TS + reloading set up
1 parent b9023a9 commit 31b6f65

File tree

7 files changed

+3295
-27
lines changed

7 files changed

+3295
-27
lines changed

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"files.exclude": {
33
"**/*.js": true,
4-
"**/*.d.ts": true,
4+
"**/*.d.ts": true
55
}
66
}

README.md

+16-18
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,33 @@
22

33
![](https://user-images.githubusercontent.com/744973/56170578-e5675b80-5f96-11e9-9ffe-9492512a0586.png)
44

5-
Functions as a Service is a demo for Google I/O '19.
6-
75
The demo shows calling Google Maps Platform APIs from Google Cloud Functions.
86

9-
We show functions firing to query photos, details, and directions to sushi restaurants within 25 miles of Google I/O.
10-
117
## Technologies
128

13-
### Google Cloud Functions
14-
159
- Cloud Functions (Node 10)
10+
- TypeScript:
11+
- Google Maps Client: https://www.npmjs.com/package/@types/google__maps
12+
- [Node.js Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-js)
13+
- Place Details API
14+
- Places Photos API
15+
- Call Routes API
1616

17-
### Google Maps Platform
17+
## Develop
1818

19-
- Place Details API
20-
- Places Photos API
21-
- Street View Static API
22-
- Call Routes API
19+
First install dependencies:
2320

24-
## Develop
21+
```sh
22+
npm i
23+
```
2524

26-
This project has two sub-projects, `gcf` and `gmp`.
25+
Then in one tab continually build the project with this command:
2726

28-
- `gcf/` holds Google Cloud Functions logic.
29-
- `cd` into this directory and run `deploy.sh` to deploy.
30-
- `gmp/` holds Google Maps Platform logic.
31-
- Publish to npm to expose this module to `gcf/`.
27+
```sh
28+
npm run build
29+
```
3230

33-
To build the project, in the parent directory, run this command:
31+
In another tab, start the web server (and watch if the source code changes):
3432

3533
```sh
3634
npm run watch

index.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// import {helloWorld} from './src/';
2+
3+
// module.exports = {
4+
// helloWorld,
5+
// };
6+
7+
import {Request, Response} from 'express';
8+
9+
exports.helloWorld = (req: Request, res: Response) => {
10+
res.send('hello');
11+
};

0 commit comments

Comments
 (0)