【发布时间】:2018-12-21 01:13:02
【问题描述】:
我在 firebase 中定义了以下路由:
// ONLY FOR TESTING
exports.findprinters = functions.https.onRequest((req, res) => {
console.log("Finding printers");
findGooglePrinters();
});
我已经部署了:
$ firebase deploy --only functions
=== Deploying to 'company-1234'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (47.21 KB) for uploading
✔ functions: functions folder uploaded successfully
i functions: creating function findprinters...
i functions: updating function quarterly_job...
i functions: updating function createNewUser...
i functions: updating function createStripeCharge...
i functions: updating function createStripeCustomer...
i functions: updating function addPaymentSource...
i functions: updating function cleanupUser...
✔ functions[createStripeCharge]: Successful update operation.
✔ functions[addPaymentSource]: Successful update operation.
✔ functions[createStripeCustomer]: Successful update operation.
✔ functions[cleanupUser]: Successful update operation.
✔ functions[createNewUser]: Successful update operation.
✔ functions[findprinters]: Successful create operation.
Function URL (findprinters): https://us-central1-company-1234.cloudfunctions.net/findprinters
✔ functions[quarterly_job]: Successful update operation.
✔ Deploy complete!
Project Console: https://console.firebase.google.com/project/company-1234/overview
但该路线似乎不起作用。我去https://company-1234.firebaseapp.com/findprinters,但它不起作用。 console.log 没有像我期望的那样记录 "Finding printers"。怎么了?
【问题讨论】:
标签: javascript firebase express google-cloud-functions firebase-hosting