url-routing

How does Angular and Express routing work together in a mean.js app?

↘锁芯ラ 提交于 2019-12-03 12:34:21
I'm struggling about Angular and Express Routing (by the way, i'm somehow new to Express), i've been handling routes with Angular — with ui-router — but now that i'm starting to build a MEAN.js Application i notice that i can handle server-side routing and client-side routing... and that's what makes me get confused, here are some of my questions: How are they different? If i switch to Express routing will i still have a SPA? Can i use both at same time? How? Is it good practice? Does it has any benefit? When should i use only one of them? How will i handle route parameters? etc... If someone

Breaking my head to get Url Routing in IIS 7 hosting environment : ASP.NET

心已入冬 提交于 2019-12-03 12:25:40
问题 I am trying to implement ASP.NET URL routing using the System.Web.Routing . And this seems to work fine on my localhost however when I go live I am getting an IIS 7's 404 error (File not found). FYI the hosting uses Windows Server 2008 IIS7. I think this is making some difference in handling the routing mechanism. But I am not able to figure out whats exactly happening. Below are the settings and changes that I've made so far to get it work and to give some credit to myself it works

Zend Framework Routing: .html extension

大城市里の小女人 提交于 2019-12-03 12:22:30
I know I've seen this done before but I can't find the information anywhere. I need to be able to route with .html extensions in the Zend Framework. I.E. /controller/action.html should route to the appropriate controller / action. We have an idea to throw away the .html extension with our .htaccess file but I think changing the route config would be the better solution. Any advice is welcome. A quick search on google yielded the following tutorials: Extending Zend Framework Route and Router for custom routing Routing and complex URLs in Zend Framework This is the plugin I've used in several

Pyramids route_url with additional query arguments

十年热恋 提交于 2019-12-03 10:43:25
In Pyramids framework, functions route_path and route_url are used to generate urls from routes configuration. So, if I have route: config.add_route('idea', 'ideas/{idea}') I am able to generate the url for it using request.route_url('idea', idea="great"); However, sometimes I may want to add additional get parameters to generate url like: idea/great?sort=asc How to do this? I have tried request.route_url('idea', idea='great', sort='asc') But that didn't work. Samuel Hapak You can add additional query arguments to url passing the _query dictionary request.route_url('idea', idea='great', _query

Generate a URL with URL Routing in Webforms

岁酱吖の 提交于 2019-12-03 08:46:18
问题 I know in the MVC Framework, you have the Html Class to create URLs: Html.ActionLink("About us", "about", "home"); But what if you want to generate Urls in Webforms? I haven't found a really good resource on the details on generating URLs with Webforms. For example, if I'm generating routes like so: Route r = new Route("{country}/{lang}/articles/{id}/{title}", new ArticleRouteHandler("~/Forms/Article.aspx")); Route r2 = new Route("{country}/{lang}/articles/", new ArticleRouteHandler("~/Forms

building a PHP router [duplicate]

浪子不回头ぞ 提交于 2019-12-03 08:34:50
Possible Duplicate: turn URL route into funciton arguments php mvc CMS Routing in MVC I'm currently trying to rewrite a PHP router. The new htaccess rewrite has the follows. <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule (.*) public/index.php?url=$1 [L] </IfModule> Whilst in index.php in public , I am getting the URL using the $url = $_GET['url']; What I need to do is to pass $url to the Router function:: route($url) If a URL is passed as : /page/function/$params which would then translate as : index.php?url=page/xapp/function , I'd need to map and route to

How to have Express routing work with Angular routing with HTML5 style URLs?

拥有回忆 提交于 2019-12-03 08:27:53
I would like to make an AngularJS app with HTML5-style URLs (i.e. with no # fragment in the URL). Thus in the routing controller module of my Angular app I've got something like the following: angular.module('app').config(['$routeProvider','$locationProvider',function($routeProvider,$locationProvider) { $locationProvider.html5Mode(true) ... } $routeProvider .when('/1/:param', /* do something */) .when('/2/:param', /* do something else */) .when('/3/:param', /* do something else again*/); A number of working examples like AngularFun don't use HTML5 mode. For a request like http://localhost:3005

How do I route images through ASP.NET routing?

余生颓废 提交于 2019-12-03 08:11:36
I'd like to create a dynamic thumbnail resizer so that you can use the following URL to get a resized image: http://server/images/image.jpg?width=320&height=240 I tried setting up a route like this: routes.MapRoute(null, "{filename}", new { controller = "Image", action = "Resize" }); But if the file exists at the URL, ASP.NET will bypass the routing and return you just the file instead. How do I force ASP.NET to route the images instead of returning what's on disk? Thats how asp.net routing works, there is no away around that... you have to use Rewrite if you want to intercept requests for

Is there a reusable router / dispatcher for PHP?

自古美人都是妖i 提交于 2019-12-03 07:49:12
I'm using a simple framework that handles requests based on query parameters. http://example.com/index.php?event=listPage http://example.com/index.php?event=itemView&id=1234 I want to put clean urls in front of this so you can access it this way: http://example.com/list http://example.com/items/1234 I know how routes and dispatching works, and I could write it myself. But I would rather take advantage of all the code out there that already solves this problem. Does anyone know of a generic library or class that provides this functionality, but will let me return whatever I want from a route

How can I assert that no route matches in a Rails integration test?

余生长醉 提交于 2019-12-03 07:44:19
I have a Rails 3 integration test which tests my routes. It contains tests such as: assert_routing( "/#{@category.url.path}/#{@foo.url.path}", { :controller => 'foo', :action => 'show', :category => @category.to_param, :foo => @foo.to_param } ) I would also like to test a case where no routes should match. Obviously, testing generation has no meaning in this case, so I just need the inverse of assert_recognizes. I'd like to be able to do something like this: assert_not_recognized('/adfhkljkdhasjklhjkldfahsjkhdf') Any ideas, short of wrapping assert_recognizes in an assert_raises block (which