Questions tagged [router]

A router is a device that forwards data packets across multiple networks. DO NOT USE THIS TAG FOR QUESTIONS REGARDING URL ROUTING OR SINGLE PAGE APPLICATION ROUTERS

NOTE: This tag should not be used for questions on configuring or port forwarding applications on routers. Such questions are off topic for StackOverflow, and should be directed to SuperUser instead. Questions involving routing in single page applications should insetad be tagged with the appropriate routing library such as or . Question asking about routing server side applications should be tagged with and the appropriate framework.

Excerpt from Wikipedia on March 29th 2011:

A router is a device that forwards data packets across computer networks. Routers perform the data "traffic directing" functions on the Internet. A router is a microprocessor-controlled device that is connected to two or more data lines from different networks. When a data packet comes in on one of the lines, the router reads the address information in the packet to determine its ultimate destination. Then, using information in its routing table, it directs the packet to the next network on its journey. A data packet is typically passed from router to router through the networks of the Internet until it gets to its destination computer. Routers also perform other tasks such as translating the data transmission protocol of the packet to the appropriate protocol of the next network, and preventing unauthorized access to a network by the use of a firewall.

The most familiar type of routers are home and small office routers that simply pass data, such as web pages and email, between the home computers and the owner's cable or DSL modem, which connects to the Internet (ISP). However more sophisticated routers range from enterprise routers, which connect large business or ISP networks up to the powerful core routers that forward data at high speed along the optical fiber lines of the Internet backbone.

3818 questions
19
votes
2 answers

Next.js router.query getting undefined on refreshing page, but works if you navigate to it from Link component

Why is router.query empty when I refresh a page with the correct id in the URL, but when when I navigate towards it through , it works? say I have /pages/[user]/index.js
hellomello
  • 8,219
  • 39
  • 151
  • 297
19
votes
1 answer

import Router from 'next/router' is it ok?

Next.js documentation mentions two ways to access the router object: useRouter for functional components and withRouter for class-based components. However, it does not mention something I came across a few times which is the Router object accessed…
fredperk
  • 737
  • 1
  • 9
  • 22
19
votes
2 answers

getting route name not the route path in twig symfony

i'm developing an application with symfony3. I want to get route name in twig. i did this : {% set current_path = path(app.request.get('_route')) %} {{ current_path }} it displays the url of the current page. But i want to get route name not the…
walidtlili
  • 840
  • 2
  • 13
  • 36
19
votes
1 answer

Flask - How to make an app externally visible through a router?

The question in short How do you run a simple Flask-based website visible to the internet, from a host PC which is accessing the internet from a wireless router? Question details I would like to make a flask application visible to the internet, as…
Pythonic
  • 2,091
  • 3
  • 21
  • 34
18
votes
1 answer

Angular 2\4 assets path files not found after prod build

I have an Angular app and I have placed an image and custom font under assets folder(src/assets/images/bg.jpg and src/assets/fonts/segoeui.ttf). I have referenced bg.jpg and segoeui.ttf in scss file, like so: styles.css: @font-face { …
Deepak
  • 1,038
  • 4
  • 18
  • 31
17
votes
1 answer

'Navigation triggered outside Angular zone' explanation

I am working on an Electron app using Angular. I have created an Electron menu item where click() sends an IPC to app.component.ts in order to change the view. The below code works, but I get the following error in DevTools if I call…
Kezz
  • 193
  • 1
  • 7
17
votes
2 answers

jasmine angular 4 unit test router.url

I am unit testing a function in angular 4 project using jasmine which a switch statement like mentioned below: switch(this.router.url) { case 'firstpath': { // some code } break; case 'secondpath': { …
Punj324
  • 215
  • 1
  • 2
  • 9
17
votes
2 answers

Go using mux Router - How to pass my DB to my handlers

At the moment, I try to create a small Web-Project using Go for data handling on the server. I try to pass my database-connection to my HandlerFunc(tions) but it does not work as expected. I am pretty new to golang, so maybe I did not understand…
Newbie
  • 1,644
  • 5
  • 29
  • 40
17
votes
16 answers

How can I determine the IP of my router/gateway in Java?

How can I determine the IP of my router/gateway in Java? I can get my IP easily enough. I can get my internet IP using a service on a website. But how can I determine my gateway's IP? This is somewhat easy in .NET if you know your way around. But…
Frank Krueger
  • 69,552
  • 46
  • 163
  • 208
16
votes
1 answer

how to unit test router.navigate in angular app

I am running unit test for angular app, I want to unit test if navigation is working correctly in angular app. if (this.customer.length == 0) { this.router.navigate(['/nocustomer']); } And the unit test for this it(`should navigate to…
karthik_personal
  • 369
  • 1
  • 3
  • 14
16
votes
4 answers

Routing to sub routing module without lazy loading

I want to have multiple routing modules in order to keep my application clean and easy to read. I currently use lazy loading for the SubComponent but I don't want to do this. So I am looking for a way to change this. Anyways, here is the currently…
Spurious
  • 1,903
  • 5
  • 27
  • 53
15
votes
5 answers

FASTAPI custom middleware getting body of request inside

Been trying to get the BODY of a request using FASTAPI middleware but it seems i can only get request.headers but not the body. I am in need of the body in order to get a key that I will use to check something on the database. Think of logging or…
JC Lopez
  • 243
  • 1
  • 2
  • 12
15
votes
4 answers

how to pass object as params in Router.push() in nextjs and access that object in other component

Router.push({pathname: '/card', query:{data: ObjectData}}) I get query as empty value could not pass object into it
Poornima Shinde
  • 159
  • 1
  • 1
  • 3
15
votes
8 answers

How to reload a page in Angular 8 the proper way

NB. I've got a set of resulting from googling but, as I explain at the end, I sense that they aren't reliable, due to diversity. I have two utility methods - one for navigating to the parent node and one for reloading self. The first one works as…
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
15
votes
1 answer

Angular 4: changing url, but component is not rendered

I'm trying to link a component from one component using routerLink = "selected" const routes: Routes = [ { path: '', children: [ { path: 'account', component: AccountComponent, …
yer
  • 1,454
  • 2
  • 16
  • 33