我最近在index.ts中部署了一个TypeScript项目到firebase-functions。一切都正常,但当我开始重构我的代码时,我很快意识到firebase不能识别index.ts之外的文件(或在functions.https.onRequest()中包装express应用程序的文件)中指定的路由。 我已经重复了下面的问题: //index.ts
import * as functions from 'firebase-functions';
import * as express from "express";
export const
我正在尝试使用Express路由器和Typescript中的类来组织我的路由。这就是我到目前为止所尝试的。index.ts文件应该引用notes.ts文件中的Notes类,该类通过私有方法公开端点。
例如,我有一个文件index.ts
import * as express from "express";
import rootRoutes from "./root";
import { Notes } from "./notes";
import accountRoutes from "./account";
const ro
我目前正在使用GCP云函数构建一个无服务器应用程序。
为了分别为每个功能部署云功能,我将模块拆分如下。
当我用index.ts编写所有函数时,它在本地运行得很好,但是当我导出它时,我无法运行它,并出现以下错误。
'getUsers' needs to be of type function. Got: object
导出方法有问题吗?
下面是在本地运行它的命令
"start": "npm run build && functions-framework --source=build/src/ --target=getUsers",
当试图将数据发送到防火墙时,您将返回以下错误:
TypeError: db.collection is not a function
at FirestoreHelper.updateDocument (/workspace/node_modules/firebase-functions-helper/dist/firestore.js:7:56)
at app.patch (/workspace/lib/index.js:20:40)
at Layer.handle [as handle_request] (/workspace/node_modules/expres
我试图在我的AngularFire2应用程序中初始化Angular2,但是我得到了以下错误。
ERROR in ./src/app/firebase/index.ts
Module build failed: Error: /Users/jaruesink/Documents/Projects/buckets/src/app/firebase/index.ts (16,17): Return type of exported function has or is using name 'ModuleWithProviders' from external module "
我有一个带有快速应用程序的Nodejs。我用tsoa注册我的路线。当我向我的nodejs应用程序添加swagger-ui-express时,我得到以下错误Error: TypeError: Router.use() requires a middleware function but got a undefined
我初始化该应用程序如下:
app.ts
import config from './api/build/config';
import express from 'express';
function star
我正在使用https、auth和datastore触发器编写firebase函数,因此我想将它们合并到不同的文件中。我已经考虑了https函数,但是我不知道如何将auth函数分解出来。我的index.ts目前是:
import * as express from 'express';
import * as functions from 'firebase-functions';
import { spiceAdmin } from './base';
import { spiceServer } from './spi
我想将应用程序Node.js迁移到Firebase。在NodeJS中,服务器使用的是:
var express = require('express');
var app = express();
app.get('/rq/bots', function (req, res) {
var query='http://externalAPIQuery?q=something'
var request = require('request');
request(query, function (error, response, bod
我有一个角度应用程序与角通用,以支持服务器端渲染(SSR)。我在根页面上有个问题。所有其他路由都能很好地工作在SSR上,但是"/"没有。作为对家乡路由的尝试,将"/“改为"/app”,并且它工作正常!!。我正在使用NestJS和Firebase云函数来呈现它。下面的文件是我认为可能导致问题的原因。
main.nest.ts
// These are important and needed before anything else.
import 'zone.js/dist/zone-node';
import '