The Opine web framework is being developed by a team of web developers based in the UK. The team is led by Craig Morten who is a web developer working for the British software company ASOS. 

 

According to Craig Morten, the main goal of Opine web framework is to port Express.js web framework to Deno.js platform despite many Deno frameworks are already available to be used for building different kind of web application.

 

“Opine aims to achieve the same great goals of Express, focusing 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 Express,” wrote Craig Morten on his blog.

 

As the result, if we already have enough experiences in using Express.js, there will not be any problem for us to use Opine to create web application running on Deno.js platform because it has the same syntax and structure as Epress.js. In fact, the bare minimal code for an Opine program to run on Deno platform is as below:

 

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

const app = opine()

app.get("/", function (req, res) {
  res.send("Hello Deno!")
})

app.listen(3000);
console.log("Opine started on port 3000")

 

To run the above program, we need to install Deno.js runtime first in our local machine by writing the command:

 

// Using Shell (macOS and Linux):
curl -fsSL https://deno.land/x/install/install.sh | sh

// Using PowerShell (Windows):
iwr https://deno.land/x/install/install.ps1 -useb | iex

 

Next, we can run this tiny program by writing command on terminal window as below:

 

deno run --allow-net ./main.ts

 

If we open the browser at the address http://localhost:3000/ we will see the sentence “Hello Deno!” is written on the browser.