Firebase Cloud Functions for GUG.cz presentation web
install/update firebase-tools globally and login
npm install -g firebase-tools
firebase login
in directory functions
run:
npm install || yarn
The repository uses Firebase remote configuration. All secret variables (e.g. Slackbot URL) should be stored there...
firebase use dev
firebase serve --only functions
All commits in brach production
are automatically deployed using Circle CI/CD.
It will always create new event!
URL: [https://us-central1-gug-web.cloudfunctions.net/saveEvent]
Auth: Bearer token
Body:
{
"eventData": {
// Required fields
"name" : "Event Name",
"regFormLink" : "https://forms.google.com",
"created" : "2018-02-03T18:00:00.000Z",
"dates" : {
"end" : "2018-02-03T18:00:00.000Z",
"isRepeatingEvent" : false,
"start" : "2018-02-03T16:00:00.000Z"
},
"venue" : {
"address" : "Venue Address",
"city" : "Venue City",
"coordinates" : {
"lat" : 10.0,
"lng" : 10.0
},
"howTo" : "", // Optional
"mapUrl" : "https://maps.google.com/",
"name" : "Venue Name"
},
"chapters" : {
"chapterId" : true,
"chapterId..." : true
},
"organizers" : {
"orgId" : true,
"orgId..." : true
},
"guarantee" : "orgId", // Guarantee have to be also in organizers list
"published" : true,
// Optional fields
"subtitle" : "Event Subtitle",
"description" : "Event Desciption (can be markdown)",
"cover" : "https://cover-url.com",
"links" : [ {
"type" : "facebook",
"url" : "facebook.com"
}, {
"type" : "meetup",
"url" : "meetup.com"
}, {
"type" : "google-plus",
"url" : "plus.google.com"
} ]
}
}
URL: [https://us-central1-gug-web.cloudfunctions.net/publishEvent]
Auth: Bearer token
Params:
- eventId: ID of event which will be published
URL: [https://us-central1-gug-web.cloudfunctions.net/unpublishEvent]
Auth: Bearer token
Params:
- eventId: ID of event which will be unpublished
Event has to be published!
URL: [https://us-central1-gug-web.cloudfunctions.net/updatePublishedEvent]
Auth: Bearer token
Params:
- eventId: ID of published event which will be updated