Created
March 21, 2013 08:09
-
-
Save Sen/5211454 to your computer and use it in GitHub Desktop.
angular.js seo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phantom = require("phantom") | |
express = require("express") | |
app = express() | |
app.get "*", (req, res) -> | |
phantom.create (ph) -> | |
ph.createPage (page) -> | |
page.open "http://localhost:9000/#{req.route.params[0]}", (status) -> | |
page.evaluate (-> document.getElementsByTagName('html')[0].outerHTML), (result) -> | |
res.end result | |
ph.exit() | |
app.listen(3002) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment