routing

ASP.NET routing: Literal sub-segment between tokens, and route values with a character from the literal sub-segment

我们两清 提交于 2019-11-29 09:26:18
The reason I'm asking is because IIS protects certain ASP.NET folders, like Bin, App_Data, App_Code, etc. Even if the URL does not map to an actual file system folder IIS rejects a URL with a path segment equal to one of the mentioned names. This means I cannot have a route like this: {controller}/{action}/{id} ... where id can be any string e.g. Catalog/Product/Bin So, instead of disabling this security measure I'm willing to change the route, using a suffix before the id, like these: {controller}/{action}_{id} // e.g. Catalog/Product_Bin {controller}/{action}/_{id} // e.g. Catalog/Product/

Rails RoutingError (No route matches [OPTIONS]

℡╲_俬逩灬. 提交于 2019-11-29 09:18:52
I'm creating a rest api using rails and making calls from a remote ember app using ember data. I'm getting this routing error on what should be a GET request. How do I create an OPTIONS method and will I have to do this for every resource? I can provide code snippets if needed. Installing and configuring this gem should allow your Rails application to properly process the options request caused by CORS: https://github.com/cyu/rack-cors 来源: https://stackoverflow.com/questions/25588699/rails-routingerror-no-route-matches-options

Routing HTTP Error 404.0 0x80070002

混江龙づ霸主 提交于 2019-11-29 09:09:04
问题 I have created routing rules in my ASP.NET application and on my Dev machine at IIS7 everything works fine. When I deploy solution to prod server which has also IIS7 I get error 404 (page not found) while accessing URL. Maybe someone could point where is the problem? Actual error HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. Detailed Error InformationModule IIS Web Core Notification MapRequestHandler

Multi-tenant ServiceStack API, same deployment to respond to requests on different hostnames?

馋奶兔 提交于 2019-11-29 09:04:40
问题 We're creating APIs using ServiceStack that are multi-tenant. We want to do DNS-based load-balancing and routing, rather than stitch things up via a reverse proxy (like nginx or haproxy). We have Request DTOs that have a Tenant parameter. ServiceStack (and its SwaggerFeature) allow us to define custom routes, and document the DTOs such that we can read values from path, query, headers, or body. How do we (best) wire things so that DTO properties can read values from a hostname pattern as well

ASP.NET Routing - Do Custom Routes COMPLETELY SKIP Everything in the Global.asax?

眉间皱痕 提交于 2019-11-29 08:35:44
I have a simple ASP.NET 3.5 SP1 Web Forms app... I've added the System.Web.Routing DLL, and I've made a simple route that returns a standard ASP.NET Page as the "IHttpHandler". All is good... except that HttpContext.Current.User is null ??? So, I did a little more digging (I put breakpoints in all the events in the Global.asax file). Normally, these breakpoints get hit (when I navigate to a standard ".aspx" page): Application_BeginRequest Application_AuthenticateRequest Application_EndRequest But, when using ASP.NET Routing... none of those events are firing. Am I missing something? Assuming

How to design and implement a simple WCF service relay?

大城市里の小女人 提交于 2019-11-29 08:06:23
We are in the process of designing a simple service-oriented architecture using WCF as the implementation framework. There are a handful of services that a few applications use. These services are mostly used internally, so a basic authentication and authorization scheme (such as Windows-based) is enough. We want, however, expose some of the services to some business partners. The set of services they have access to depend on the contract. Kind of a standard architecture. I think we can implement a service gateway which authenticates the requests and relays them to the correct internal service

Adding a route to a MKMapView

点点圈 提交于 2019-11-29 08:01:11
I'm trying to add a routing feature to an app I'm working on. I found Craig Spitzkoff's article on how to draw lines on an MKMapView which works pretty good. But since I don't have the coordinates of the points on the roads that doesn't help me as expected. Is there any way to determine the coordinates between to given points, say my current position and another address? Basically you will need to make an HTTP request to the Google Directions API . The terms of service state that you have to display the results on a Google map, but I think because you are using an MKMapView, you will be fine:

Implementing find node on torrent kademlia routing table

ぐ巨炮叔叔 提交于 2019-11-29 07:25:34
I, already, reviewed a number of documents on this topic but there is something not exactly clear. For example bit torrent document ( http://www.bittorrent.org/beps/bep_0005.html ) states The routing table is subdivided into "buckets" that each cover a portion of the space. An empty table has one bucket with an ID space range of min=0, max=2^160. When a node with ID "N" is inserted into the table, it is placed within the bucket that has min <= N < max. An empty table has only one bucket so any node must fit within it. Each bucket can only hold K nodes, currently eight, before becoming "full."

Pre-routing with querystrings with Express in Node JS

前提是你 提交于 2019-11-29 07:13:29
I'm trying to use express to parse the querystring in case certain parameters are set and execute a little piece of code, before the actual routing is happening. The use-case is to grab a certain value, that could be set, independant of what link is being used. I use express' functionality to pass the stuff to the next possible rule using next(). So far, I tried - at the very top of all the app.get/post-rule-block: app.get('[?&]something=([^&#]*)', function(req, res, next) { var somethingID = req.params.something; // Below line is just there to illustrate that it's working. Actual code will do

Rails Routing with Query String

旧城冷巷雨未停 提交于 2019-11-29 07:06:36
I have a problem where I need values passed in from a GET request and I don't know how to set up the routing definition. My Category object has a type(string),a color(string) and many products. I want to create a simple web service that lets the caller get all of a Category's products by passing in the Category's type and color: http://www.myapp.com/getProducts?catType=toy&color=red or ? http://www.myapp.com/categories/getProducts?catType=toy&color=red How do I define the correct routing for this situation? Are there better ways to do this in a Restful manner... because I know that Rails is