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
171
votes
19 answers

Wrapping a react-router Link in an html button

Using suggested method: This is the result: A link in the button, Code in between comment lines I was wondering if there is a way to wrap a Link element from 'react-router' in an HTML button tag using react. I currently have Link components to…
Jose Rivera
  • 1,821
  • 2
  • 12
  • 8
167
votes
6 answers

RouterModule.forRoot(ROUTES) vs RouterModule.forChild(ROUTES)

What is the differences between these two and what are the use cases for each? The docs aren't exactly helpful: forRoot creates a module that contains all the directives, the given routes, and the router service itself. forChild creates a module…
VSO
  • 11,546
  • 25
  • 99
  • 187
113
votes
11 answers

SSH -L connection successful, but localhost port forwarding not working "channel 3: open failed: connect failed: Connection refused"

My lab runs RStudio on a server. A couple weeks ago, from my cousin's house, I successfully ssh'd into the server and pulled up the server-side RStudio through my local Firefox browser. Now when I try to access the server RStudio from home (via my…
user2762495
  • 1,173
  • 2
  • 9
  • 8
84
votes
9 answers

How to separate routes on Node.js and Express 4?

I want to separate Routes from my server.js file. I am following this tutorial on Scotch.io http://scotch.io/tutorials/javascript/build-a-restful-api-using-node-and-express-4 It is working if all lines are on server.js file. But I am failing to…
yellowbuck
  • 1,071
  • 1
  • 15
  • 20
79
votes
4 answers

Angular2 Router error: cannot find primary outlet to load 'HomePage'

I just started using the new routing library (@angular/router v3.0.0-alpha.7) but following the official docs leads to error below: browser_adapter.ts:74: EXCEPTION: Error: Uncaught (in promise): Error: Cannot find primary outlet to load…
David
  • 3,075
  • 3
  • 26
  • 36
67
votes
2 answers

Ruby on rails: singular resource and form_for

I want user to work with only one order connected to user's session. So I set singular resource for order routes.rb: resource :order views/orders/new.html.erb: <%= form_for @order do |f| %> ... <% end %> But when I open the new order page I get…
petRUShka
  • 9,812
  • 12
  • 61
  • 95
63
votes
2 answers

Redirect user with router depending on logged in status

I would like to automatically route to a login page if the user is not logged in. app.module.ts import { RouterModule, Routes } from '@angular/router'; import { AppComponent } from './app.component'; import { LoginComponent } from…
Rafael Moura
  • 1,247
  • 2
  • 14
  • 26
45
votes
3 answers

Multiple routers vs single router in BackboneJs

All examples on Backbone I've seen use one router for the whole application, but wouldn't it make sense to have a router for each single part of your app (header, footer, stage, sidebar)? Has anyone built apps with more than one router and what are…
Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297
45
votes
2 answers

Accessing $route.params in VueJS

Looking through this documentation: https://router.vuejs.org/en/essentials/navigation.html It looks like you can bind the Link Text Which is pretty nifty; however, I've had some trouble trying to access…
user8310317
44
votes
5 answers

Angular 4 - Failed: Can't resolve all parameters for ActivatedRoute: (?, ?, ?, ?, ?, ?, ?, ?)

I have referred the following link to get the answers, but I couldn't find any working solution for my scenario. Error: (SystemJS) Can't resolve all parameters for ActivatedRoute: (?, ?, ?, ?, ?, ?, ?, ?) Therefore, I have been trying to remove the…
Lakindu Gunasekara
  • 4,221
  • 4
  • 27
  • 41
41
votes
4 answers

Simulating a bad internet connection

I'm developing an embedded device which has access to the internet through LAN. I'm in the testing phase now, and I would like to test how the device performs when the connection to the internet is poor. Currently, the device is connected to a…
stdcall
  • 27,613
  • 18
  • 81
  • 125
41
votes
7 answers

Is there a way to catch all non-matched routes with Backbone?

I want to have a 'catch all' route which runs when none of the other defined routes are matched. A type of 404 NotFound error handler. I've tried adding this, which works but prevents other routes from matching: this.route(/(.*)/, 'notFound',…
evilcelery
  • 15,941
  • 8
  • 42
  • 54
38
votes
9 answers

Cant load a react app after starting server

(node:13176) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option. (Use node --trace-deprecation ... to show where the warning was…
Sagar Nilgar
  • 389
  • 1
  • 3
  • 4
37
votes
3 answers

Angular2 conditional routing

This might be a basic question, but in Angular2 is there any way to do conditional routing ? Or, would someone do that outside the router ? I know ui-router had some ability to do this, but I haven't seen anything similar in Angular2s router
user3884414
  • 373
  • 1
  • 3
  • 4
36
votes
5 answers

React router, how to restore state after browser back button?

I'm trying to figure out how to make my React SPA app maintain state when the user navigates with the back/forward browser buttons. E.g. the user is filling a form, then he moves back and forward and the form is automatically restored. I reviewed…
nino.porcino
  • 1,133
  • 1
  • 8
  • 16
1
2 3
99 100