<h1 id="publicist-middleware">Publicist Middleware</h1> <p><a href="https://badge.fury.io/js/publicist-middleware"><img src="http://img.shields.io/npm/v/publicist-middleware.svg?style=flat" alt="npm"></a> <a href="https://travis-ci.org/carrot/publicist-middleware"><img src="http://img.shields.io/travis/carrot/publicist-middleware/master.svg?style=flat" alt="tests"></a> <a href="https://david-dm.org/carrot/publicist-middleware"><img src="http://img.shields.io/gemnasium/carrot/publicist-middleware.svg?style=flat" alt="dependencies"></a></p> <p>locking static sites down since 1888</p> <blockquote> <p><strong>Note:</strong> This project is in early development, and versioning is a little different. <a href="http://markup.im/#q4_cRZ1Q">Read this</a> for more details.</p> </blockquote> <h3 id="why-should-you-care-">Why should you care?</h3> <p>Let's be clear here, HTTP Basic Auth isn't the most secure thing in the world, but many times it's all you really need. Whether you're staging a site for a private audience or hiding a couple trade secrets adding a username and password to your static site should be easy. Simply provide Publicist a <code style="font-family: 'Bitstream Vera Sans Mono';">username:password</code> string and we'll do the heavy lifting.</p> <h3 id="installation">Installation</h3> <p><code style="font-family: 'Bitstream Vera Sans Mono';">npm install publicist-middleware --save</code></p> <h3 id="usage">Usage</h3> <p>This library can be used with connect, express, and any other server stack that accepts the same middleware format. A very basic usage example:</p> <pre class="editor-colors"><code class="lang-js" style="font-family: 'Bitstream Vera Sans Mono';"><div><span class="source js"><span class="storage modifier js">var</span> http <span class="keyword operator js">=</span> require<span class="meta brace round js">(</span><span class="string quoted single js"><span class="punctuation definition string begin js">'</span>http<span class="punctuation definition string end js">'</span></span><span class="meta brace round js">)</span><span class="punctuation terminator statement js">;</span></span></div><div><span class="source js">    connect <span class="keyword operator js">=</span> require<span class="meta brace round js">(</span><span class="string quoted single js"><span class="punctuation definition string begin js">'</span>connect<span class="punctuation definition string end js">'</span></span><span class="meta brace round js">)</span><span class="meta delimiter object comma js">,</span></span></div><div><span class="source js">    publicist <span class="keyword operator js">=</span> require<span class="meta brace round js">(</span><span class="string quoted single js"><span class="punctuation definition string begin js">'</span>publicist-middleware<span class="punctuation definition string end js">'</span></span><span class="meta brace round js">)</span><span class="punctuation terminator statement js">;</span></span></div><div>&nbsp;</div><div><span class="source js"><span class="storage modifier js">var</span> app <span class="keyword operator js">=</span> connect<span class="meta brace round js">()</span></span></div><div><span class="source js">  <span class="meta delimiter method period js">.</span>use<span class="meta brace round js">(</span>publicist<span class="meta brace round js">(</span>auth: <span class="string quoted single js"><span class="punctuation definition string begin js">'</span>username:password<span class="punctuation definition string end js">'</span></span><span class="meta brace round js">)</span></span></div><div><span class="source js">  <span class="meta delimiter method period js">.</span>use<span class="meta brace round js">(</span>connect<span class="meta delimiter method period js">.</span>static<span class="meta brace round js">(</span><span class="string quoted single js"><span class="punctuation definition string begin js">'</span>public<span class="punctuation definition string end js">'</span></span><span class="meta brace round js">))</span><span class="punctuation terminator statement js">;</span></span></div><div>&nbsp;</div><div><span class="source js"><span class="storage modifier js">var</span> server <span class="keyword operator js">=</span> http<span class="meta delimiter method period js">.</span>createServer<span class="meta brace round js">(</span>app<span class="meta brace round js">)</span><span class="meta delimiter method period js">.</span>listen<span class="meta brace round js">(</span><span class="constant numeric js">1111</span><span class="meta brace round js">)</span></span></div></code></pre> <h3 id="license-contributing">License &amp; Contributing</h3> <ul> <li>Details on the license <a href="LICENSE.md">can be found here</a></li> <li>Details on running tests and contributing <a href="contributing.md">can be found here</a></li> </ul>