This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is just an extension of https://github.com/gruntjs/grunt-contrib-connect#middleware | |
grunt.initConfig({ | |
connect: { | |
server: { | |
options: { | |
middleware: function(connect, options) { | |
var middlewares = []; | |
if (!Array.isArray(options.base)) { | |
options.base = [options.base]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert'); | |
var net = require('net'); | |
var open = process.binding('fs').open; | |
var sendfile = process.binding('fs').sendfile; | |
if (process.argv.length < 4) { | |
console.error('usage: sendfile <port> <path>'); | |
process.exit(1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |