Module

x/opine/README.md

Fast, minimalist web framework for Deno ported from ExpressJS.
Go to Latest
File

opine

Fast, minimalist web framework for Deno ported from ExpressJS.

Test deno doc PRs Welcome Maintenance HitCount

import opine from "https://deno.land/x/opine@master/mod.ts";

const app = opine();

app.use((req, res) => {
  res.send("Hello World");
});

app.listen(3000);

Installation

This is a Deno module available to import direct from this repo and via the Deno Registry.

Before importing, download and install Deno.

You can then import Opine straight into your project:

import opine from "https://deno.land/x/opine@master/mod.ts";

If you want to use a specific version of Opine, just modify the import url to contain the version:

import opine from "https://deno.land/x/opine@0.3.0/mod.ts";

Or if you want to use a specific commit of Opine, just modify the import url to contain the commit hash:

import opine from "https://deno.land/x/opine@c21f8d6/mod.ts";

Features

  • Robust routing
  • Focus on high performance
  • HTTP helpers
  • Content negotiation

And more to come as we achieve feature parity with ExpressJS.

Docs

Philosophy

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.

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.

As time passes, Opine’s goals may naturally diverge from ExpressJS and this will be reflected here.

Examples

To run the examples, you have two choices:

  1. Run the example using Deno directly from GitHub, for example:

    deno run --allow-net --allow-read https://raw.githubusercontent.com/asos-craigmorten/opine/master/examples/hello-world/index.ts
  2. Clone the Opine repo locally:

    git clone git://github.com/asos-craigmorten/opine.git --depth 1
    cd opine

    Then run the example you want:

    deno --allow-net --allow-read ./example/hello-world/index.ts

All the examples contain example commands in their READMEs to help get you started for either of the above methods.

Contributing

Contributing guide


License

There are several third party modules that have been ported into this module. Each third party module has maintained it’s license and copyrights. The only exception is for Express, from which this entire module has been ported, whose license and copyrights are available at EXPRESS_LICENSE in the root of this repository, and cover all files within the source directory which not been explicitly licensed otherwise.

All modules adapted into this module are licensed under the MIT License.

Opine is licensed under the MIT License.