node package manager


Passive URL shortening for Angular.JS


The "I'm feeling lucky" URL shortener

// Make sure transclusion (see 
angular.module('transclude', [])
 .directive('pane', function(){
    return {
      restrict: 'E',
      transclude: true,
      scope: { title:'@' },
      template: '<div style="border: 1px solid black;">' +
                  '<div style="background-color: gray">{{title}}</div>' +
                  '<div ng-transclude></div>' +

friend: dude, what is transclusion?


[ understanding the view]( understanding the view) uses Google's "I'm feeling lucky" functionality to redirect you to the first search result.

Note that, because this is a search, the page you're redirected to may change in the future. However, you can rest assured that you'll always be redirected to the page that Google finds most relevant. can be used to search any domain. See the configuration section and fire up your own instance. has no dependencies, start it with:

PORT=8080 node server.js

Configure with the following environment variables:

Variable Description Default
PORT The port to run the server on. 3000
SERVICE The search service to use google or bing. google
SEARCH_DOMAIN The domain to search.
FALLBACK_URL The fallback URL for empty queries.

Note:: Bing does not have an "I'm feeling lucky" equivalent, so you'll be redirected to Bing's search result page instead.

SEARCH_DOMAIN="" FALLBACK_URL="" PORT=8080 node server.js