ExpressRoute is a service that enables you to create private connections between Azure datacenters and infrastructure that's on your premises or in a colocation environment.
Questions tagged [express-router]
185 questions
5
votes
1 answer
Failed to add delegation to the existing subnet
I'm trying to include in an app service an existing VNET but i have this issue:
Failed to add delegation to the existing subnet.:
Delegations of subnet /subscriptions
Cannot be changed from [] to [Microsoft.Web/serverfarms] because it is being…
![](../../users/profiles/4569295.webp)
Julien
- 199
- 1
- 8
5
votes
1 answer
Express middleware calls multiple times
I've checked other posts related to this topic and couldn't find the problem in my code.
const myMiddleware = (fn) => {
return (req, res, next) => {
var fullUrl = req.protocol + '://' + req.get('host') + req.url;
…
![](../../users/profiles/4335588.webp)
Thellimist
- 2,939
- 3
- 26
- 43
4
votes
1 answer
Express router : Router.use() requires a middleware function but got a Object
I know there are lot of questions in SO but none of them gave me a solution
routes/authentication/index.js
import { Router } from 'express'
const router = Router();
router.get('/', (_req, _res) => console.log("Works"))
// module.exports = router …
![](../../users/profiles/11283638.webp)
Ashutosh patole
- 336
- 3
- 13
4
votes
0 answers
how to fix a mongoose strictmode error on an updateOne?
i have a model like this :
Mongoose Schema
var LinkedinUpdateSchema = new mongoose.Schema({
likes:{values:[PersonSchema],
_total: Number},
numLikes: Number,
timestamp: Number,
updateComments:{
values:[CommentSchema],
_total:…
![](../../users/profiles/10385798.webp)
Lars Hendriks
- 803
- 2
- 16
3
votes
1 answer
Parallelism of Puppeteer with Express Router Node JS. How to pass page between routes while maintaining concurrency
app.post('/api/auth/check', async (req, res) => {
try {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(
'https://www.google.com'
);
res.json({message: 'Success'})
} catch (e) {
…
![](../../users/profiles/15547056.webp)
apsenT
- 33
- 3
3
votes
1 answer
Route.get() requires a callback function but got a [object Undefined]. What did I do wrong?
I have checked many answers in other pages and forums, but I still don't get it. What did I do wrong? Help me
*edited. I have added requiring routes and app.use. It looks like function isLOggedIn is not exporting but I don't know how to do that. I…
![](../../users/profiles/12595802.webp)
Booi Mangang
- 31
- 3
3
votes
2 answers
How to gracefully handle promise rejection in express
I have the following express controller
class ThingsController {
static async index(req, res, next) {
try {
const things = await Thing.all();
res.json(things);
} catch(err) {
next(err);
}
}
}
and…
![](../../users/profiles/3676469.webp)
Hirurg103
- 3,515
- 1
- 21
- 44
3
votes
1 answer
Promise not returning any data for fetch return
I´m building an express router that uses mongoose to access the database. My current problem relies on this piece of code:
app.use("/authreset", (req, res) => {
authenticator
.resetPassword(
req.body.username,
…
![](../../users/profiles/2697571.webp)
Mendes
- 13,757
- 24
- 122
- 217
2
votes
1 answer
TypeScript/Eslint throwing a 'Promise returned' error on a Express Router async route
I have the following endpoint setup to reset a database after test runs:
import { getConnection } from 'typeorm';
import express from 'express';
const router = express.Router();
const resetDatabase = async (): Promise => {
const connection…
![](../../users/profiles/12188968.webp)
HigoChumbo
- 155
- 1
- 8
2
votes
1 answer
How do we pass parameters to a mounted route in nodeJS?
I'm taking a course on NodeJS, there were a few assignments related to routing, everything works fine except this part which seems a little odd: For some reason, I cannot read the parameter ID being passed to the mounted router.
dish.js
const…
![](../../users/profiles/5179550.webp)
Mike Gmez
- 103
- 1
- 14
2
votes
2 answers
Make get request to third party API with api key using express.router();
I am building a react app, and in it I am retrieving data from a third party site which requires me to send the API key in the header using 'X-Auth-Token'.
Currently I am making this request using fetch() api from the clientside js files.
I…
![](../../users/profiles/4659400.webp)
Jonny
- 593
- 4
- 15
2
votes
1 answer
How express.route determined route
I'm start learning about Node.js (with Express.js) and React.js. So I have some question about Express Router
Let's see my part of code
server.js
const app = express();
const apiRouter = require("./Routes/apiRoute");
app.use("/api",…
![](../../users/profiles/2506290.webp)
Chanom First
- 1,074
- 1
- 10
- 22
2
votes
1 answer
What is the difference between Routing in React and Express
I am having trouble understanding the difference between routing in frontend and backend.
My basic understanding is that the React-router will map a component to a URL like:
![](../../users/profiles/6181130.webp)
Darren rogers
- 467
- 1
- 6
- 13
2
votes
1 answer
How to app use all routes from different file
I'm trying to separate my routes, previously i'm including them to my app.js
/backend/app.js
const express = require("express");
const router = require("./routes");
const status = require("./routes/status");
const register =…
![](../../users/profiles/10580401.webp)
Jacobs Naskzmana
- 35
- 4
2
votes
1 answer
I want to add a function in where() in Model.find() method but its giving typo error included in Body
Providing the code where on passing a path is giving me a type error which is included below
function maxDis(lat1, lon1, location) {
var fields = location.split(':');
var lat2 = parseFloat(fields[0]);
var lon2 = parseFloat(fields[1]);
…
![](../../users/profiles/9717489.webp)
user9717489
- 251
- 1
- 4
- 8