var apiURL = 'https://1dhhcnzmxi.execute-api.us-east-1.amazonaws.com/v1';
var staticURL = 'https://d1gxzanke6jb5q.cloudfront.net';

var get = function(username, id) {
};

exports.handler = function(event, context) {
  console.log(event);
  get(event.username, event.id).then(context.succeed).catch(context.fail);
};

var apiURL = 'https://1dhhcnzmxi.execute-api.us-east-1.amazonaws.com/v1';
var staticURL = 'https://d1gxzanke6jb5q.cloudfront.net';

var React = require('react');
var views = require('./views');

var fetchJSON = function(username, id) {
  var url = apiURL + '/' + username;
  if (id) url += '/' + id;
  return fetch(url).then(function(res) {
    return res.json();
  });
};

var generateHTML = function(json) {
  var reactString = React.renderToString(React.createElement(views.Blog, json));
  return "<html><body>" + reactString + "</body></html>";
};

exports.handler = function(event, context) {
  console.log(event);
  fetchJSON(event.username, event.id).then(context.succeed).catch(context.fail);
};

use render to string