Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kferrone/kellyferrone.serverless

Serverless cloud functions for me! https://github.com/kferrone/kellyferrone.com
https://github.com/kferrone/kellyferrone.serverless

Last synced: 26 days ago
JSON representation

Serverless cloud functions for me! https://github.com/kferrone/kellyferrone.com

Awesome Lists containing this project

README

        

# My Cloud Functions

These are used as the back end stuff for the frontend blogger site.

Here are the three needed functions:
* [email](functions/email/README.md)

Google Cloud Platform logo

# Google Cloud Functions - SendGrid sample

See:

* [Cloud Functions SendGrid tutorial][tutorial]
* [Cloud Functions SendGrid sample source code][code]

[tutorial]: https://cloud.google.com/functions/docs/tutorials/sendgrid
[code]: index.js

## Dependencies
- NodeJS8

## Deploy and run the sample

See the [Cloud Functions SendGrid tutorial][tutorial].

## Run the tests

1. Read and follow the [prerequisites](../../#how-to-run-the-tests).

**notes:**

* On Windows run this: `npm config set script-shell "C:\\Program Files\\Git\\bin\\bash.exe"`

1. Install dependencies:

npm install

1. Run the tests:

npm test

## Config

Create a file called `config.json` with the following:

```json
{
"host": "",
"blogger": {
"key": "",
"blogID": ""
},
"sendGrid": {
"key": "",
"email": ""
},
"gCloud": {
"project": "",
"region": "",
"eventBucket":"",
"dataset": ""
},
"webhooks": {
"username": "",
"password": ""
}
}
```

then run the command below to save

```sh
firebase functions:config:set app="$(cat config.json)"
```

now run this to see the config
```sh
firebase functions:config:get app
```

## Deployment

To deploy the functions manually simply run:

```sh
firebase deploy
```

To deploy the automated CI way, you must first update the version of the project with node:

```sh
npm version patch
```