Skip to content

Instantly share code, notes, and snippets.

Anita Czapla heron2014

Block or report user

Report or block heron2014

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View react-lifecycle-parent-child.jsx
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
heron2014 / hapi-boom-json-api.js
Created Jul 22, 2016
hapi plugin to reformat boom errors to json-api
View hapi-boom-json-api.js
exports.register = function (plugin, options, done) {
plugin.ext('onPreResponse', function (request, reply) {
var response = request.response;
if (response.isBoom) {
var error = {
title: response.output.payload.error,
status: response.output.statusCode,
detail: response.output.payload.message
You can’t perform that action at this time.