Last active
May 5, 2016 21:51
-
-
Save d7my11/b3d0ddb7910b22acb3ae0a6edc2f0e21 to your computer and use it in GitHub Desktop.
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
var express = require("express"); | |
var app = express(); | |
app.use(require('prerender-node').set('prerenderServiceUrl', 'http://localhost:1337/').set('prerenderToken', 'TOKEN')); | |
app.use(express.static(__dirname + "/app")); | |
app.use("/app/bower_components", express.static(__dirname + "/app/bower_components")); | |
app.use("/app/dist/min/css/fonts/", express.static(__dirname + "/app/dist/min/css/fonts/")); | |
app.all('/*', function(req, res, next) { | |
res.sendFile("/app/index.html", { root: __dirname }); | |
}); | |
app.listen(process.env.PORT || 3000); |
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
{ | |
"name": "cosmetips", | |
"version": "0.0.0", | |
"dependencies": { | |
"express": "^4.13.3", | |
"prerender-node": "^2.2.0" | |
} | |
} |
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
var express = require("express"); | |
var app = express(); | |
app.use(express.static(__dirname + "/")); | |
app.use(require("prerender-node").set("prerenderToken", "MY-TOKEN")); | |
app.all('/*', function(req, res, next) { | |
res.sendFile("/index.html", { root: __dirname }); | |
}); | |
app.listen(process.env.PORT || 3000); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment