Skip to main content
Module

x/opine/docs/index.html

Fast, minimalist web framework for Deno ported from ExpressJS.
Go to Latest
File
<!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>) =&gt;</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&#39;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">&quot;application&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_methods_.html">&quot;methods&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_middleware_init_.html">&quot;middleware/init&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_middleware_query_.html">&quot;middleware/query&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_opine_.html">&quot;opine&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_request_.html">&quot;request&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_response_.html">&quot;response&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_router_index_.html">&quot;router/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_router_layer_.html">&quot;router/layer&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_router_route_.html">&quot;router/route&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_types_.html">&quot;types&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_compileetag_.html">&quot;utils/compileETag&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_contentdisposition_.html">&quot;utils/content<wbr>Disposition&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_definegetter_.html">&quot;utils/define<wbr>Getter&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_encodeurl_.html">&quot;utils/encode<wbr>Url&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_escapehtml_.html">&quot;utils/escape<wbr>Html&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_etag_.html">&quot;utils/etag&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_finalhandler_.html">&quot;utils/final<wbr>Handler&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_fresh_.html">&quot;utils/fresh&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_merge_.html">&quot;utils/merge&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_mergedescriptors_.html">&quot;utils/merge<wbr>Descriptors&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_pathtoregex_.html">&quot;utils/path<wbr>ToRegex&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_stringify_.html">&quot;utils/stringify&quot;</a> </li> <li class=" tsd-kind-module"> <a href="modules/_utils_url_.html">&quot;utils/url&quot;</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>