Skip to content

Instantly share code, notes, and snippets.

@jourdein
Created March 28, 2015 11:16
Show Gist options
  • Save jourdein/fd19e9c3f764a33b6c59 to your computer and use it in GitHub Desktop.
Save jourdein/fd19e9c3f764a33b6c59 to your computer and use it in GitHub Desktop.
Webby Angular-SEO

Webby Angular-SEO

Main Reference

1. Run PhantomJS Server

phantomjs --disk-cache=no ./bower_components/angular-seo/angular-seo-server.js 9090 http://127.0.0.1:9011/

2. Run Our Application

./node_modules/.bin/http-server -p 9011

3. Testing Your Pre-Rendered HTML

curl 'http://127.0.0.1:9090/app/?_escaped_fragment_=/new'

Notes

The original page is accessible at http://127.0.0.1:9011/app/#!/new


Other available pages:

  • http://127.0.0.1:9011/app/#!/list
  • http://127.0.0.1:9011/app/#!/other

4. Going Live

Read http://lawsonry.com/2014/05/diy-angularjs-seo-with-phantomjs-the-easy-way/

Something like

if ($args ~ <em>escaped_fragment</em>) {
  # Proxy to PhantomJS instance here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment