Questions tagged [req]
53 questions
0
votes
2 answers
Accessing Proxy Server address from my nodejs?
i'm using nodemailer to send a confirmation email on my project,
like so:
var mailOptions = {
from: "alex@account",
to: req.body.email,
subject: "Account Verification Token",
html: `
Hello,
Please verify your account…

Alexander
- 1,288
- 5
- 19
- 38
0
votes
1 answer
Array.find() method usage with req.param in TypeScript
I am trying to understand basics of "express" package of JS and I am stuck with getting array elements based on index that comes from URL.
Here is my code, this is almost a copy of udemy instructor's code, I was writing simultaneosly.
const express…

HARUN SASMAZ
- 567
- 1
- 7
- 17
0
votes
1 answer
Node redirection to random link of one array
I have one script in node, and i want to automatically redirect to randoms links that i have in one array, the page is white and doesn't redirect when i put the maths.random function
There is my code :
const http = require('http');
let randURLs =…

Benjamin Barbé
- 281
- 2
- 4
- 16
0
votes
3 answers
NodeJS RESTful API - How to handle 'undefined' request variables properly?
I am developing a RESTful API using NodeJS and Express.
I noticed that incoming requests sometimes lack of some expected variables, which cause the program to crash, saying it couldn't set the value of a variable, to an 'undefined' value - as no…

StackMaster
- 359
- 1
- 5
- 22
-1
votes
2 answers
How I can set direction as only Tx message should be there and filter out TxRq
I am writing a CAPL script to mimic a CAN message on network. While I am getting intended message, direction is both Tx & TxRq. How I can filter out and send only Tx message.
I tried CANID.dir=1 (tx) however not getting intended result.
Message…

Prashant Thakre
- 3
- 2
-1
votes
2 answers
Req ex for 9+2 Numerci plus decimal values
I am looking for a regular expression with the following requirements:
9 + 2 after decimal
If amount is zero, it should be invalid
I tried ^[1-9][0-9]*$ but it does work.

ShareYourExp
- 11
- 1
- 1
- 5
-2
votes
3 answers
req.params not giving anything in express nodejs
I am trying to use the following code to get Id in the url. The problem is that req.params is not giving anything from the route.
app.get("/getAllParcels/:Id",(req,res) => {
custId = req.params.Id;
res.send('this is parcel with id:',…
-3
votes
1 answer
How to put data to req body
Welcome again. I have a problem with POST route. My question is: is it possible to get data as an array from li tag in req.body?
HTML code: