Coder Social home page Coder Social logo

muskanmahajan37 / functions-as-a-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlesamples/functions-as-a-service

0.0 0.0 0.0 45 KB

A demo showing Google Cloud Functions + Google Maps Platform

License: Apache License 2.0

TypeScript 98.12% Shell 1.88%

functions-as-a-service's Introduction

Functions as a Service

The demo shows calling Google Maps Platform APIs from Google Cloud Functions.

Technologies

Develop

First install dependencies:

npm i

Then in one tab continually build the project with this command:

npm run build

In another tab, start the web server (and watch if the source code changes):

API_KEY=<KEY> npm run watch

This uses npm-watch with the functions-framework to auto re-build the server after changes.

Test locally

Go to http://localhost:8080 to run your Google Cloud Function locally.

Here are some example URL requests:

http://localhost:8080/directions?mode=driving&origin=37.7841393,-122.404467
http://localhost:8080/origins?origin=6
http://localhost:8080/places?origin=37.7841393,-122.114167

API Key

To create an API key, use the Cloud Console credentials page:

https://console.cloud.google.com/apis/credentials

More detailed instructions can be found in the "Get API Key" guide.

After creating an API key, enable these APIs:

Deploy

You must create a .env.yaml with your API Key:

API_KEY=AIsdfyCnTEiLTroDN14NTtpPm1n7jrBR844ID4A

You can deploy this project to Google Cloud Functions by running the following script:

gcloud config set project $MY_PROJECT
sh deploy.sh

functions-as-a-service's People

Contributors

grant avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.