June 2018
Beginner to intermediate
394 pages
9h 2m
English
Using functions.https, we can trigger Firebase functions. We can make use of HTTP methods such as GET, POST, PUT, DELETE, and OPTIONS, using the onRequest function and passing a request and response as a parameter, as shown here:
exports.date = functions.https.onRequest((req, res) => { // ...});
The request object holds access to most of the properties send by the client. The response object sends the response back to the client.
We will use the Express Node.js Module/library to perform the HTTP requests, since Express has all the standard request templates and more.
The following example uses a complete Express application and exposes a single cloud function:
const app = express(); app.use(cors({ origin: true })); app.use(myMiddleware) ...
Read now
Unlock full access