Very Popular
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261<!doctype html><html class="default no-js"><head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title></title> <meta name="description" content="Documentation for "> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="assets/css/main.css"></head><body><header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="assets/js/search.json" data-base="."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="index.html" class="title"></a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="globals.html">Globals</a> </li> </ul> <h1></h1> </div> </div></header><div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <div class="tsd-panel tsd-typography"> <a href="#opine" id="opine" style="color: inherit; text-decoration: none;"> <h1>opine</h1> </a> <p>Fast, minimalist web framework for <a href="https://deno.land/">Deno</a> ported from <a href="https://github.com/expressjs/express">ExpressJS</a>.</p> <p><a href="https://doc.deno.land/https/deno.land/x/opine/mod.ts"><img src="https://doc.deno.land/badge.svg" alt="deno doc"></a></p> <pre><code class="language-ts"><span class="hljs-keyword">import</span> opine <span class="hljs-keyword">from</span> <span class="hljs-string">"https://deno.land/x/opine@master/mod.ts"</span>;
<span class="hljs-keyword">const</span> app = opine();
app.use(<span class="hljs-function">(<span class="hljs-params">req, res</span>) =></span> { res.send(<span class="hljs-string">"Hello World"</span>);});
app.listen({ port: <span class="hljs-number">3333</span> });</code></pre> <a href="#installation" id="installation" style="color: inherit; text-decoration: none;"> <h2>Installation</h2> </a> <p>This is a <a href="https://deno.land/">Deno</a> module available to import direct from this repo and via the <a href="https://deno.land/x">Deno Registry</a>.</p> <p>Before importing, <a href="https://deno.land/#installation">download and install Deno</a>.</p> <p>You can then import Opine straight into your project:</p> <pre><code class="language-ts"><span class="hljs-keyword">import</span> opine <span class="hljs-keyword">from</span> <span class="hljs-string">"https://deno.land/x/opine@master/mod.ts"</span>;</code></pre> <a href="#features" id="features" style="color: inherit; text-decoration: none;"> <h2>Features</h2> </a> <ul> <li>Robust routing</li> <li>Focus on high performance</li> <li>HTTP helpers</li> </ul> <p>And more to come as we achieve feature parity with <a href="https://github.com/expressjs/express">ExpressJS</a>.</p> <a href="#docs" id="docs" style="color: inherit; text-decoration: none;"> <h2>Docs</h2> </a> <ul> <li><a href="https://github.com/asos-craigmorten/opine/blob/master/.github/API/api.md">Opine API Docs</a></li> <li><a href="https://asos-craigmorten.github.io/opine/">Opine Type Docs</a></li> <li><a href="https://doc.deno.land/https/deno.land/x/opine/mod.ts">Opine Deno Docs</a></li> <li><a href="https://expressjs.com/en/4x/api.html">ExpressJS API Docs</a></li> <li><a href="https://github.com/asos-craigmorten/opine/blob/master/LICENSE.md">License</a></li> <li><a href="https://github.com/asos-craigmorten/opine/blob/master/EXPRESS_LICENSE.md">ExpressJS License</a></li> <li><a href="https://github.com/asos-craigmorten/opine/blob/master/.github/CHANGELOG.md">Changelog</a></li> </ul> <a href="#philosophy" id="philosophy" style="color: inherit; text-decoration: none;"> <h2>Philosophy</h2> </a> <p>The Express philosophy is to provide small, robust tooling for HTTP servers, making it a great solution for single page applications, web sites, hybrids, or public HTTP APIs.</p> <p>Opine will aim to achieve these same great goals, focussing first on developing robust tooling and features before moving onto accelerating performance and becoming super lightweight.</p> <p>As time passes, Opine's goals may naturally diverge from <a href="https://github.com/expressjs/express">ExpressJS</a> and this will be reflected here.</p> <a href="#examples" id="examples" style="color: inherit; text-decoration: none;"> <h2>Examples</h2> </a> <p>To view the examples, clone the Opine repo:</p> <pre><code class="language-bash">git <span class="hljs-built_in">clone</span> git://github.com/asos-craigmorten/opine.git --depth 1<span class="hljs-built_in">cd</span> opine</code></pre> <p>Then run whichever example you want:</p> <pre><code class="language-bash">deno --allow-net --allow-read ./example/hello-world/index.ts</code></pre> <a href="#contributing" id="contributing" style="color: inherit; text-decoration: none;"> <h2>Contributing</h2> </a> <p><a href="https://github.com/asos-craigmorten/opine/blob/master/.github/CONTRIBUTING.md">Contributing guide</a></p> <a href="#developing" id="developing" style="color: inherit; text-decoration: none;"> <h2>Developing</h2> </a> <a href="#run-tests" id="run-tests" style="color: inherit; text-decoration: none;"> <h3>Run Tests</h3> </a> <pre><code class="language-bash">make <span class="hljs-built_in">test</span></code></pre> <a href="#run-benchmarks" id="run-benchmarks" style="color: inherit; text-decoration: none;"> <h3>Run Benchmarks</h3> </a> <pre><code class="language-bash">make benchmark</code></pre> <a href="#format-code" id="format-code" style="color: inherit; text-decoration: none;"> <h3>Format Code</h3> </a> <pre><code class="language-bash">make fmt</code></pre> <a href="#generate-documentation" id="generate-documentation" style="color: inherit; text-decoration: none;"> <h3>Generate Documentation</h3> </a> <pre><code class="language-bash">make typedoc</code></pre> </div> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="globals.html"><em>Globals</em></a> </li> <li class=" tsd-kind-module"> <a href="modules/_application_.html">"application"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_methods_.html">"methods"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_middleware_init_.html">"middleware/init"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_middleware_query_.html">"middleware/query"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_opine_.html">"opine"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_request_.html">"request"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_response_.html">"response"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_router_index_.html">"router/index"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_router_layer_.html">"router/layer"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_router_route_.html">"router/route"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_types_.html">"types"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_compileetag_.html">"utils/compileETag"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_contentdisposition_.html">"utils/content<wbr>Disposition"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_definegetter_.html">"utils/define<wbr>Getter"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_encodeurl_.html">"utils/encode<wbr>Url"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_escapehtml_.html">"utils/escape<wbr>Html"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_etag_.html">"utils/etag"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_finalhandler_.html">"utils/final<wbr>Handler"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_fresh_.html">"utils/fresh"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_merge_.html">"utils/merge"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_mergedescriptors_.html">"utils/merge<wbr>Descriptors"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_pathtoregex_.html">"utils/path<wbr>ToRegex"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_stringify_.html">"utils/stringify"</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_url_.html">"utils/url"</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> </ul> </nav> </div> </div></div><footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> <li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> </ul> </div> </div></footer><div class="container tsd-generator"> <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/js/main.js"></script><script>if (location.protocol == 'file:') document.write('<script src="assets/js/search.js"><' + '/script>');</script></body></html>