English 中文(简体)
在GET号快车要求中通过多个变量时,第一种变数最重。 问 题
原标题:When passing multiple variables in Express GET request only the first variable shows up in the reqest.query

我正在讨论一个在节点上明示的问题。 我的服务器边代码有一个终端点,以压缩用户标识。 这项请求击中了一个带有多个用户参数的标志终点。 这里是打上我明确签名的粗略要求。

<代码> http://127.0.0.1:5003/cloud-medic/us- central1/app/signup?email=express&password=asdf&firstName=asdf&lastName=asdf&gender=Male&birthDate=1706763000

The server side code as I mentioned uses express to handle this GET request. I created an app file to house the express request and firebase configuration.

var functions = require("firebase-functions");
const { getDatabase, ref, set, child, push, update } = require("firebase/database");
const { getFirestore, Timestamp, FieldValue, Filter } = require( firebase-admin/firestore );
const { initializeApp } =  require( firebase-admin/app );
const express = require( express );
var cors = require( cors );

const firebaseConfig = {
  //CONFIG INFO
}

const admin = initializeApp(firebaseConfig);
const db = getFirestore(admin);

const app = express();
app.use(cors());

var router = express.Router();

exports.db = db;
exports.app = app;//functions.https.onRequest(app);
exports.admin = admin;

这里是具有路由功能的指数文档。 它界定了信号功能要求。

var user = require( ./user );
var functions = require("firebase-functions");
const { db, admin, app } = require( ./app );

app.get( /signup , function (request, response) {
    console.log("THIS IS A GET FUNCTION");
    console.log(request.query);

    user.signup(request, response);

}); 

当我用上述曲线要求打上标志终点时,我收到以下重克。

{ email:  express  }

All of the other get request url parameters are not passed, just the first one (email). Any help is appreciated.

问题回答

我的明确守则并不是我的问题。 更 正 我在曲线指挥中犯了一个错误。 我原想在引文中提出这一要求。

curl  http://127.0.0.1:5003/cloud-medic/us-central1/app/signup?email=express&password=asdf&firstName=asdf&lastName=asdf&gender=Male&birthDate=1706763600000 

我希望,如果你 across倒这一职务,我的错误就会使你回答你的问题。





相关问题
How to make Sequelize use singular table names

I have an model called User but Sequelize looks for the table USERS whenever I am trying to save in the DB. Does anyone know how to set Sequelize to use singular table names? Thanks.

What is Node.js? [closed]

I don t fully get what Node.js is all about. Maybe it s because I am mainly a web based business application developer. What is it and what is the use of it? My understanding so far is that: The ...

Clientside going serverside with node.js

I`ve been looking for a serverside language for some time, and python got my attention somewhat. But as I already know and love javascript, I now want learn to code on the server with js and node.js. ...

Can I use jQuery with Node.js?

Is it possible to use jQuery selectors/DOM manipulation on the server-side using Node.js?

How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...

热门标签