All Projects β†’ JohannLai β†’ doa

JohannLai / doa

Licence: MIT License
A middleware framework for Deno's http serveπŸ¦•. Transplanted from Koa with ❀️

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to doa

Grant
OAuth Proxy
Stars: ✭ 3,509 (+17445%)
Mutual labels:  middleware, koa
Koa Useragent
Koa user-agent middleware
Stars: ✭ 54 (+170%)
Mutual labels:  middleware, koa
Concurrency Logger
Log HTTP requests/responses separately, visualize their concurrency and report logs/errors in context of a request.
Stars: ✭ 400 (+1900%)
Mutual labels:  middleware, koa
Koa Helmet
Important security headers for koa
Stars: ✭ 595 (+2875%)
Mutual labels:  middleware, koa
Tsed
πŸ“ Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone.
Stars: ✭ 1,941 (+9605%)
Mutual labels:  middleware, koa
stats
πŸ“Š Request statistics middleware that stores response times, status code counts, etc
Stars: ✭ 15 (-25%)
Mutual labels:  middleware, koa
Kona
a node.js service framework built on koa.js (generators)
Stars: ✭ 23 (+15%)
Mutual labels:  middleware, koa
koa-waterline
Deprecated: A middleware for your hose
Stars: ✭ 14 (-30%)
Mutual labels:  middleware, koa
Awilix Koa
Awilix helpers/middleware for Koa 2
Stars: ✭ 121 (+505%)
Mutual labels:  middleware, koa
Service Tools
Prepare your Node.js application for production
Stars: ✭ 89 (+345%)
Mutual labels:  middleware, koa
Koatty
Koa2 + Typescript = Koatty. Use Typescript's decorator implement IOC and AOP.
Stars: ✭ 67 (+235%)
Mutual labels:  middleware, koa
oak-middleware-jwt
Oak middleware for JWT
Stars: ✭ 24 (+20%)
Mutual labels:  middleware, deno
Koa Hbs
Handlebars templates for Koa.js
Stars: ✭ 156 (+680%)
Mutual labels:  middleware, koa
polix
πŸš€ Node.js Web Framework
Stars: ✭ 32 (+60%)
Mutual labels:  middleware, koa
jwt-auth
JSON Web Token Authentication for Laravel and Lumen
Stars: ✭ 46 (+130%)
Mutual labels:  middleware
mooseware
πŸ’€ Skeleton for writing a middleware handler
Stars: ✭ 47 (+135%)
Mutual labels:  middleware
lesvim
Nvim config focus on Javascript, Typescript, Rust and Lua - πŸš€ πŸ’ͺ ( Fast and Powerfull ) - Deno and other typescript LSP working well together
Stars: ✭ 69 (+245%)
Mutual labels:  deno
co-wechat-payment
Wechat payment lib for node.js koa framework.
Stars: ✭ 20 (+0%)
Mutual labels:  koa
core
🌈 light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection
Stars: ✭ 40 (+100%)
Mutual labels:  deno
lin-cms-koa-core
A simple and practical CMS implememted by koa
Stars: ✭ 42 (+110%)
Mutual labels:  koa
Doa middleware framework for deno

Github Action Status PRs Welcome GitHub license tag tag

All Contributors

A middleware framework for Deno's http serve. Transplanted from Koa.

⚑️ Quick start

A basic usage, responding to every request with Hello World;

import { App } from "https://deno.land/x/doa/mod.ts";

const app = new App();

app.use(async ctx => {
  ctx.status = 200;
  ctx.body = "Hello World";
});

app.listen({ port: 8000 });

Adding middlewares through app.use(middleware), will cause all of the middlewares to be executed upon each request in the specified order. When you call the middleware, it passed the context and next method in the stack.

A more complex example with responseTime middleware, which will add x-response-time in the response header:

import { App } from "https://deno.land/x/doa/mod.ts";
import { responseTime } from "https://deno.land/x/response-time/mod.ts";

const app = new App();

app.use(responseTime());

app.use(async ctx => {
  ctx.status = 200;
  ctx.body = "Hello World";
});

app.listen({ port: 8000 });

πŸ“‘ docs

For more information see https://koajs.com/.

πŸ§ͺ Running tests

More than 199 test cases( over 90% οΌ‰ to ensure code quality.

$ deno test --allow-read --allow-write --allow-net --allow-hrtime  

# test result: ok. 199 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (715ms)

πŸš€ Running benchmarks

Use wrk to benchmark doa.

$ deno run --allow-net --allow-env  ./example.ts
$ make -C benchmarks 

🎯 Trouble Shooting

Make sure you are using deno 1.1.3 and std 0.59.0. Doa will continue to update deno to the latest version later.

License

MIT

Contributors ✨

Thanks goes to these wonderful people (emoji key):


JohannLai

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].