Skip to content

Instantly share code, notes, and snippets.

View brianhyder's full-sized avatar

Brian brianhyder

  • Live Oak Bank
  • Raleigh, NC
View GitHub Profile
@brianhyder
brianhyder / cors.js
Created December 11, 2016 17:57
PencilBlue Router Framework & Request Pipeline
/**
* An example of adding middleware.
* It injects code into the request pipeline that adds a header to allows resources from the server to be accessed by other domains.
*/
class CorsPlugin {
static onStartupWithContext (context, cb) {
var middlewareName = 'addCorsHeader';
var middleware = {
@brianhyder
brianhyder / cors_controller.js
Last active August 29, 2015 14:26
Creating a Cross-Origin Resource Sharing (CORS) Controller in PencilBlue
/*
Copyright (C) 2015 PencilBlue, LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@brianhyder
brianhyder / config.json
Created December 2, 2014 19:15
Multi-Instance PencilBlue Configuration - All Mongo (No Cache Required)
{
"siteRoot": "http://mypencilblue.site.com",
"siteIP": "0.0.0.0",
"log_level": "info",
"registry": {
"type": "mongo",
"update_interval": 1000
},
"cache": {
"fake": true,