From the course: Firebase Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
The Search Restaurants function - Google Cloud Tutorial
From the course: Firebase Essential Training
The Search Restaurants function
- [Instructor] Okay, the last cloud function we're going to implement in this section is a cloud function for searching restaurants, so that when the user types something in this search box here and clicks search, this list will change with a list of matching restaurants. And as I mentioned earlier, right now, we're only going to support searching restaurants by name, but this could obviously be extended to include some much more complex search functionality. So what we're going to do is start off by creating our function inside our functions directory. So inside our functions, source, restaurants directory, we're going to create a new file called searchRestaurants.js and hit enter. And our function is going to look like this. We're going to import * as functions from 'firebase-functions', import * as admin from 'firebase-admin', and export const searchRestaurants = functions.https.onCall, async (data, context). That's all…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Control access with Cloud Functions1m 42s
-
(Locked)
Set up to run functions locally7m
-
(Locked)
Run Cloud Functions2m 55s
-
(Locked)
The Make a Reservation function, part 18m 44s
-
(Locked)
The Make a Reservation function, part 25m 12s
-
(Locked)
The Submit Review function11m 37s
-
(Locked)
The Cancel Reservation function7m 17s
-
(Locked)
The Get Recommendations function6m 55s
-
(Locked)
The Search Restaurants function6m 20s
-
-
-
-
-