Skip to content

Instantly share code, notes, and snippets.

@pimterry
Created May 18, 2016 13:27
Show Gist options
  • Save pimterry/d88989aa8e47c36622354af058965f37 to your computer and use it in GitHub Desktop.
Save pimterry/d88989aa8e47c36622354af058965f37 to your computer and use it in GitHub Desktop.
var fs = require("fs");
var express = require("express");
var components = require("server-components");
require("./linkify-example-component.js");
require("./google-analytics-example-component.js");
var html = fs.readFileSync("index.html");
var app = express();
app.get('/', function (req, res) {
components.renderPage(html).then((output) => {
res.send(output);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment