Code Monkey home page Code Monkey logo

denzo's Introduction

Denzo

Well designed web framework for Deno. similar to Fastify. Uses Deno native http server. (which is unstable right now)

Hello world

app.ts

import {
  Denzo,
  listenAndServe,
  printRoutes,
} from "https://deno.land/x/denzo/mod.ts";

const app = new Denzo();

interface RouteTypes {
  Response: {
    hello: string;
  };
}

app.route<RouteTypes>({
  method: "GET",
  url: "/hi",
  handler() {
    return { hello: "world!" };
  },
});

listenAndServe(3000, app);
printRoutes(app);

console.log("listening on port 3000");
deno run --allow-net --unstable app.ts

See examples

Goals

Well and Reliable design: Denzo follows Fastify design which benefit large projects.
Fast: Denzo uses brand new Deno native http server which is faster and better for http/2 protocol.
First-Class validation: Like Fastify, Denzo support JSON schemes (also fluent-json-schema).
Safe: Plugins are limited to their scope, unless you grant access.

Differences with Fastify

Denzo is inspired by Fastify, but it doesn't mean it's a Fastify port for Deno. There's some differences that we prefer:

No callback support

Callbacks are fast, but supporting callbacks and promises together is troublesome. so you should always use async function or return a Promise for your async code.

Keys instead of decorators

Fastify decorators design is not Typescript friendly, You can use our Keys design to safely pass data between hooks. see examples/keys.ts.

Plugins

Official

Discord chat

We would love to hear your feedback and questions! https://discord.gg/YP5TgWbd2C

denzo's People

Contributors

disizali avatar erfanium avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

denzo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.