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
2 answers

How do I get the {{id}} from the url in express +Node.js

I'm trying to create a CRUD app using Node and express, i'm relatively new to it. I have an ideas page and an edit button on each idea. I keep on getting the error "Cannot GET /ideas/edit1/" when I click the edit button(this view exists by the way).…
Augustin
  • 15
  • 3
0
votes
1 answer

Mongoose and express router issue with more than one get

Good morning everyone, I'm stuck in this problem and I can't find a way to solve. I think is really easy to but I can't find the error. I'm just trying to create 3 routes with express to get all active tournaments, just one selected with the…
0
votes
0 answers

Error in react when i add express in router folder

When i add const express = require('express') in my routes/index.js i get this error enter image description here
plox
  • 1
0
votes
1 answer

Express - enabling catch all for Angular 1.x html5Mode with multiple router files is not working

Okay so this question originates from this post, which is also my question but sorta moved onto this problem. Now the problem is, my angular app works but when it comes to Node routes, like /login, the browser thinks it's an Angular route. The…
Sean
  • 1,151
  • 3
  • 15
  • 37
0
votes
1 answer

How can pass the app instance to route file in ExpressJs?

I'm using Express framework to develop my backend APIs, but I encounter with one issue today. I have one server.js (entry) file from there I want to pass app instance to routes/api.js file. where I wanted to check if endpoint prefix is /api/v2 then…
Shivam Verma
  • 905
  • 1
  • 8
  • 20
0
votes
1 answer

Problem with writing signup method in Angular+NodeJS program

I am trying to write a simple signup method and the followings are the codes I used: ClientSide_codes,auth.servise.ts: checkUserExistence(user : User) : any { this.http.get(baseURL + 'users/findUser') .subscribe(res => { …
Hasani
  • 3,543
  • 14
  • 65
  • 125
0
votes
1 answer

React-Router and Express-Router conflict

I am stuck on one problem while hitting api post request from react-app to express server. Route confliction arises. While sending post request, in browser network tab posting is successful but requesting goes on loading. what might be the…
0
votes
1 answer

Remove subroute from express middleware

I have NodeJs App in which i am using a middleware for authorization which is as follows:- app.use('/api', authorizeMiddleWare, routes); and there is routes which consists of all the routes which is suppose as follows:- router.use('/route1',…
0
votes
1 answer

Nodejs how to pass parameters into an exported route from another route?

Suppose I module export "/route1" in route1.js, how would I pass parameters into this route from "/route2" defined in route2.js? route1.js module.exports = (app) => { app.post('/route1', (req,res)=>{ console.log(req.body); …
jyoo
  • 47
  • 1
  • 6
0
votes
0 answers

How do you use two or more route.js files in Express Router in Node?

I am not running into any errors but I am wondering if this is the correct way to use two or more route.js files using express.Router. Am I using module.exports = router correctly as they are in two separate files, or is there a different…
ckingchris
  • 559
  • 1
  • 12
  • 25
0
votes
1 answer

Data store in wrong table after using Node Express route

I am using node js and express for the backend, REST API and database is Postgresql. I am using Sequelize for connection and models. I have created two models, one is a student and another is a course. I tested my app by using POSTMAN and everything…
babla19830
  • 77
  • 1
  • 1
  • 10
0
votes
1 answer

Request parameter in Express router

I'm having some trouble accessing request parameters in express router. My server.js file has this: app.use('/user/:id/profile', require('./routes/profile'); And this is in my ./routes/profile.js file: router.get('/', (req, res) => { …
Aneesh Dandime
  • 123
  • 1
  • 11
0
votes
1 answer

How to redirect to a top route from a nested route with node express?

How can I redirect to a top route from a nested route? On the code below, the callback for the route /toproute/nested should redirect to /profile instead of /toproute/profile. // app.js const express = require('express'); const app =…
Vinicius Santana
  • 3,936
  • 3
  • 25
  • 42
0
votes
2 answers

How to render HTML file from express while using Ract as front end?

I'm new in the world of web development and I have a problem that seems dumb but it's taking me a lot of time. I've made an express server that runs React in the front end. I run both (react and express server) by parsing my react app with webpack…
0
votes
1 answer

Math regex express route

I'm tring to filter a route with param, but no success. I have 2 routes: /all /:id I'm using typescript-rest to dynamic load, so there's no way to add the all route first. Server.loadServices(this.appWebApi, 'app/resources/*.js',…
Lucas Fernando
  • 344
  • 3
  • 11