ann*_*123 3 firebase google-cloud-functions firebase-cli
I am creating my first firebase function app and I was going/following through this tutorial/repo
So what I did was in my main file Index.js (inside functions folder)
const app = express();
const functions = require("firebase-functions");
const authRoutes = require("./src/routes/auth.js");
const meetupRoutes = require("./src/routes/meetup.js");
const eventbriteRoutes = require("./src/routes/eventbrite.js");
const nonMiddleWareRoutes = require("./src/routes/nonMiddleware.js");
app.use("/", nonMiddleWareRoutes);
app.use("/auth", authRoutes);
app.use("/meetup", meetupRoutes);
app.use("/eventbrite", eventbriteRoutes);
const api = functions.https.onRequest(app);
module.exports = {
api
};
Run Code Online (Sandbox Code Playgroud)
now moving back to the root folder we have firebase.json which just contains this
{}
Run Code Online (Sandbox Code Playgroud)
and .firebaserc
{
"projects": {
"default": "functions-firebase-2312"
}
}
Run Code Online (Sandbox Code Playgroud)
Now, Whenever I do firebase deploy, it logs this in terminal
=== Deploying to 'functions-firebase-2312'...
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 (60.3 KB) for uploading
? functions: functions folder uploaded successfully
i functions: updating Node.js 8 function api(us-central1)...
? functions[api(us-central1)]: Successful update operation.
? Deploy complete!
Please note that it can take up to 30 seconds for your updated functions to propagate.
Project Console: https://console.firebase.google.com/project/functions-firebase-2312/overview
Run Code Online (Sandbox Code Playgroud)
but does not give me the url for the function.
知道我可能做错了什么吗?
| 归档时间: |
|
| 查看次数: |
501 次 |
| 最近记录: |