- 2.3.4Latest
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- 1.9.1
- 1.9.0
- 1.8.0
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- 0.28.0
- 0.27.1
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.1
- 0.23.0
- 0.22.2
- 0.22.1
- 0.22.0
- 0.21.6
- 0.21.5
- 0.21.4
- 0.21.3
- 0.21.2
- 0.21.1
- 0.21.0
- 0.20.2
- 0.20.1
- 0.20.0
- 0.19.1
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
Opine
A minimalist web framework for Deno ported from ExpressJS.
Now in maintenance mode: Deno has introduced Node and NPM compat, considering using Express itself in Deno!
import express from "npm:express";
Express not working for you? Raise an issue on Deno and keep reading for Opine usage 🎉
Table of Contents
- Getting Started
- Installation
- Features
- Documentation
- Quick Start
- Philosophy
- Examples
- Contributing
- License
Getting Started
import { opine } from "https://deno.land/x/opine@2.3.3/mod.ts";
const app = opine();
app.get("/", function (req, res) {
res.send("Hello World");
});
app.listen(3000, () =>
console.log("server has started on http://localhost: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@2.3.3/mod.ts";
Opine is also available on nest.land, a package registry for Deno on the Blockchain.
import { opine } from "https://x.nest.land/opine@2.3.3/mod.ts";
Features
- Robust routing
- Large selection of HTTP helpers including support for downloading / sending files, etags, Content-Disposition, cookies, JSONP etc.
- Support for static serving of assets
- View system supporting template engines
- Content negotiation
Documentation
- Opine Docs - usually the best place when getting started ✨
- Opine Type Docs
- Opine Deno Docs
- ExpressJS API Docs
- License
- ExpressJS License
- Changelog
Quick Start
The quickest way to get started with Opine is to utilize the Opine CLI to generate an application as shown below:
Install the executable. The executable’s major version will match Opine’s:
deno install -f -q --allow-read --allow-write --allow-net --unstable https://deno.land/x/opinecli@2.0.0/opine-cli.ts
And follow any suggestions to update your PATH
environment variable.
Create the app:
opine-cli --view=ejs hello-deno && cd hello-deno
Start your Opine app at http://localhost:3000/
:
deno run --allow-net --allow-read --allow-env mod.ts
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 aimed to achieve these same great goals, focussing on providing equivalent robust tooling and features for Deno uses.
Now Deno’s Node compatibility layer is maturing sufficiently to support Express out of the box, Opine is operating maintenance mode.
Examples
To run the examples, you have two choices:
Run the example using Deno directly from GitHub, for example:
deno run --allow-net --allow-read https://raw.githubusercontent.com/cmorten/opine/main/examples/hello-world/index.ts
Clone the Opine repo locally:
git clone git://github.com/cmorten/opine.git --depth 1 cd opine
Then run the example you want:
deno run --allow-net --allow-read ./examples/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
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.
Icon designed and created by Hannah Morten.