express

Google Cloud Functions Build failed: function.js does not exist; Error ID: 7485c5b6

一曲冷凌霜 提交于 2021-01-24 20:20:31
问题 I generated a demo express server using these steps: npm install -g express-generator express myExpressApp --view pug Needless to say, the app runs fine on my local machine ( npm start ) I then pushed the code to Cloud Source Repositories Then deploy to Google Cloud Functions through their web app What am I missing? Source codes of my generated demo app: /myExpressApp/app.js var createError = require('http-errors'); var express = require('express'); var path = require('path'); var

Google Cloud Functions Build failed: function.js does not exist; Error ID: 7485c5b6

微笑、不失礼 提交于 2021-01-24 20:16:03
问题 I generated a demo express server using these steps: npm install -g express-generator express myExpressApp --view pug Needless to say, the app runs fine on my local machine ( npm start ) I then pushed the code to Cloud Source Repositories Then deploy to Google Cloud Functions through their web app What am I missing? Source codes of my generated demo app: /myExpressApp/app.js var createError = require('http-errors'); var express = require('express'); var path = require('path'); var

.where() firestore query not working properly?

偶尔善良 提交于 2021-01-24 13:40:26
问题 In the below code, when I remove the .where() from my query the query works and I get my comments returned. However, when I use the where query to try and find a comment bound to a post (scream) id, i get a blank array. Am I using .where() incorrectly? Any help would be appreciated. exports.getScream = (req, res) => { let screamData = {}; db.doc(`/screams/${req.params.screamId}`) .get() .then((doc) => { screamData = doc.data(); screamData.screamId = doc.id; return db .collection('comments')

.where() firestore query not working properly?

人走茶凉 提交于 2021-01-24 13:39:31
问题 In the below code, when I remove the .where() from my query the query works and I get my comments returned. However, when I use the where query to try and find a comment bound to a post (scream) id, i get a blank array. Am I using .where() incorrectly? Any help would be appreciated. exports.getScream = (req, res) => { let screamData = {}; db.doc(`/screams/${req.params.screamId}`) .get() .then((doc) => { screamData = doc.data(); screamData.screamId = doc.id; return db .collection('comments')

.where() firestore query not working properly?

妖精的绣舞 提交于 2021-01-24 13:38:09
问题 In the below code, when I remove the .where() from my query the query works and I get my comments returned. However, when I use the where query to try and find a comment bound to a post (scream) id, i get a blank array. Am I using .where() incorrectly? Any help would be appreciated. exports.getScream = (req, res) => { let screamData = {}; db.doc(`/screams/${req.params.screamId}`) .get() .then((doc) => { screamData = doc.data(); screamData.screamId = doc.id; return db .collection('comments')

ejs async true with node Express

浪尽此生 提交于 2021-01-24 11:29:48
问题 I want to call some of my functions which are asynchronous to be called from within my ejs files. Like I have this functions set as my app.locals.someFunction async someFunction(param){ let data = await someAsyncStuff(); // & other things return data; } and I want to use it inside ejs file as below: <% let data = await someFunction() for(let x of data){%> <li><%=x%></li> <%}%> This is possible with ejs if {async:true} is passed as an option. But where exactly should I pass this when my view

CORS problems on HEROKU

谁都会走 提交于 2021-01-23 04:50:31
问题 I have problem with CORS on Heroku. This is my code on server import express from 'express'; import bodyParser from 'body-parser'; import mongoose from 'mongoose'; require('dotenv').config() import filmRoutes from './api/routes/films' import userRoutes from './api/routes/users' const app = express() const DBNAME = process.env.DB_USER const DBPASSWORD = process.env.DB_PASS mongoose.connect(`mongodb://${DBNAME}:${DBPASSWORD}@ds157422.mlab.com:57422/filmbase`, {useNewUrlParser: true}) app.use

CORS problems on HEROKU

人走茶凉 提交于 2021-01-23 04:48:55
问题 I have problem with CORS on Heroku. This is my code on server import express from 'express'; import bodyParser from 'body-parser'; import mongoose from 'mongoose'; require('dotenv').config() import filmRoutes from './api/routes/films' import userRoutes from './api/routes/users' const app = express() const DBNAME = process.env.DB_USER const DBPASSWORD = process.env.DB_PASS mongoose.connect(`mongodb://${DBNAME}:${DBPASSWORD}@ds157422.mlab.com:57422/filmbase`, {useNewUrlParser: true}) app.use

CORS problems on HEROKU

放肆的年华 提交于 2021-01-23 04:47:48
问题 I have problem with CORS on Heroku. This is my code on server import express from 'express'; import bodyParser from 'body-parser'; import mongoose from 'mongoose'; require('dotenv').config() import filmRoutes from './api/routes/films' import userRoutes from './api/routes/users' const app = express() const DBNAME = process.env.DB_USER const DBPASSWORD = process.env.DB_PASS mongoose.connect(`mongodb://${DBNAME}:${DBPASSWORD}@ds157422.mlab.com:57422/filmbase`, {useNewUrlParser: true}) app.use

CORS problems on HEROKU

最后都变了- 提交于 2021-01-23 04:45:28
问题 I have problem with CORS on Heroku. This is my code on server import express from 'express'; import bodyParser from 'body-parser'; import mongoose from 'mongoose'; require('dotenv').config() import filmRoutes from './api/routes/films' import userRoutes from './api/routes/users' const app = express() const DBNAME = process.env.DB_USER const DBPASSWORD = process.env.DB_PASS mongoose.connect(`mongodb://${DBNAME}:${DBPASSWORD}@ds157422.mlab.com:57422/filmbase`, {useNewUrlParser: true}) app.use