Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Matthias Adler macedigital

I may be slow to respond.
View GitHub Profile
macedigital / index.js
Created Apr 26, 2018
Handle runtime exception with express-js
View index.js
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
const xmlparser = require('express-xml-bodyparser');
app.use(xmlparser());'/xml', (req, res, next) => {
console.log(req.body); // handle parsed xml
macedigital / express-xml-bodyparser.js
Created Jan 16, 2017
Alternative for parsing incoming XML in express apps, instead of using
View express-xml-bodyparser.js
var express = require('express'),
typeis = require('type-is');
var app = express();
var xmlParseOptions = {
async: false, // Setting to `true` causes issues with exceptions
explicitArray: false,
trim: true,
normalize: true,
#!/usr/bin/env bash
# Names of latest versions of each package
export VERSION_PCRE=pcre-8.39
export VERSION_ZLIB=zlib-1.2.8
export VERSION_LIBRESSL=libressl-2.4.2
export VERSION_NGINX=nginx-1.11.3
# URLs to the source directories
macedigital / express-xml-bodyparser-sample.js
Created Sep 18, 2015
Minimal example for using express-body-parser middleware
View express-xml-bodyparser-sample.js
var express = require('express');
var app = express();
var http = require('http');
var server = http.createServer(app);
var xmlparser = require('express-xml-bodyparser');
// fyi: it'd be better to attach the parser to wanted routes only
app.use(xmlparser());'/xml', function(req, res, next) {
macedigital / gist:ea540099097f7ec4c2f5
Last active Aug 29, 2015
Solarium 3.x Solr 5.1.x Curl Adapter GET method fix
View gist:ea540099097f7ec4c2f5
--- symfony/vendor/solarium/solarium/library/Solarium/Core/Client/Adapter/Curl.php (revision )
+++ symfony/vendor/solarium/solarium/library/Solarium/Core/Client/Adapter/Curl.php (revision )
@@ -155,10 +155,6 @@
curl_setopt($handler, CURLOPT_PROXY, $proxy);
- if (!isset($options['headers']['Content-Type'])) {
- $options['headers']['Content-Type'] = 'text/xml; charset=utf-8';
- }
macedigital / rss.jade
Created Apr 1, 2014
Using jade template to render rss-feed in nodejs
View rss.jade
doctype xml
title= feed.title
description= feed.description
language= feed.en
for item in posts
title= item.title