Questions tagged [express-router]

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.

265 questions
0
votes
1 answer

Express.js internal, where are stored the mount paths on the app object?

I'm facing a very specific use case, where I need to access the mount paths of various express sub apps when iterating over the app object. Sample code : const express = require("express") const app = express() app.use("/users", new…
Radioreve
  • 3,173
  • 3
  • 19
  • 32
0
votes
1 answer

Add existing ExpressRoute to existing Azure Fabric Cluster

I created a Azure Fabric Cluster without ExpressRoute without any gateway. Created from Azure portal with all default options. Now, my fabric cluster service is not able to access to onprem servers. I understand I need to setup a ExpressRoute for…
user43286
  • 2,261
  • 3
  • 31
  • 42
0
votes
1 answer

How to work with implied function parameters in NodeJS

In my website's routes file, I have a function like this: router.post('/', ctrl1.validate, ctrl2.doSomething) With the validate function looking like this: function(req,res,next){ var errors = validator.checkForm('myForm') if(errors){ …
Isaac Krementsov
  • 646
  • 2
  • 12
  • 28
0
votes
1 answer

Node Express Router can't get response params

I can not retrieve route parameters with a simple express.Router() in an web app. Here is a minimal example: var http = require('http'); const express = require('express'); const app = express(); app.use('/hello/:world', express.Router() …
swiss_knight
  • 5,787
  • 8
  • 50
  • 92
0
votes
2 answers

How to get params from url with React front end and express backend?

I'm building an react app with an express backend. I'm now adding socket io chat functionality to the front end. Everything works as expected but now I want to access params from the url to set the socket-io channel name. I want the user to visit…
grabury
  • 4,797
  • 14
  • 67
  • 125
0
votes
1 answer

Mongoose errors doesn't raise from router to app

There's single api application like this: const express = require('express') const app = express() const router = require('express').Router() ... route.post('/dogs', (req, res, next) => { const dog = new Dog() // it defined in real app …
Iworb
  • 522
  • 7
  • 29
0
votes
1 answer

Express router regex issue

I am using express router in my project, I am facing following problem, I have 2 routes as follows router.get("/user/:id", (req, res) => { console.log("---- ABCD ---"); }); router.get("/user/list", (req, res) => { console.log("---- PQRS…
prashant
  • 127
  • 2
  • 10
0
votes
2 answers

How to get a 404 response with a invalid route parameter in Node.js

I have a node.js API I am working on that has some parameter variables in the URL. One of the tasks I need to achieve is that when a particular id is not valid (as in the id number does not exist in the sqlite database), is that it returns a…
Chocolol
  • 1
  • 1
0
votes
1 answer

Mean Stack Root Routing is not working

Can someone help me why default route is not working in my Mean App, But the next routing works Here when I open http://localhost:3000 I am not able to see any output, But I have defined route in route.js which is working var express =…
Mahesh G
  • 1,226
  • 4
  • 30
  • 57
0
votes
1 answer

expressJS routing issue, simple stuff not resolving

I've recently moved all my route code into separate files, but now my route resolution is spotty. Here's a simple example - My app.js const express = require('express'); const app = express(); var dataLoader =…
j-p
  • 3,698
  • 9
  • 50
  • 93
0
votes
1 answer

Router.use() requires a middle function, but got an Object. module.exports = router exists on page

from app.js // REQUIRE ROUTES var commentRoutes = require("./routes/comments"), bpostRoutes = require("./routes/bposts"), indexRoutes = require("./routes/index"); //USE ROUTES app.use("/", indexRoutes); app.use("/bposts",…
-1
votes
1 answer

Cant resolve why its not recognising express

For the below code import pkg from 'express'; const { express } = pkg; import dotenv from 'dotenv' import { Connection } from './database/db.js'; import router from './routes/route.js'; dotenv.config(); const app = express(); app.use('/',…
-1
votes
1 answer

Data center migration with Azure Migrate

Do you need hybrid connectivity with expressroute or S2S to execute a data center migration with Azure Migrate if your goal is to exit the data center? Thank you in advance.
-1
votes
1 answer

(Express)How to pass a value from function to another one in express.Router().get

How I can pass value from function to another one at router.get router.get('/someurl', (req, res, next) => { const token = req.headers.authorization.split(' ')[1] //jwtToken const jwt = jwt.verify( token, jwtSecret ) ...do something to pass…
m3nnn0
  • 25
  • 1
  • 4
-1
votes
1 answer

Are async routing functions and asynchronous middleware in Express blocking the execution process (in 2021)?

I know that Express allows to execute asynchronous functions in the routes and in the middlewares, but is this correct? I read the documentation and it specifies that NO ROUTES OR ASYNCHRONOUS MIDDLEWARES SHOULD BE ASSIGNED, today, currently, does…
Grizzly
  • 371
  • 2
  • 13
1 2 3
17
18