博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
开源Nodejs微服务项目推荐:micro
阅读量:7223 次
发布时间:2019-06-29

本文共 889 字,大约阅读时间需要 2 分钟。

hot3.png

Micro — Async HTTP microservices

Features

  • Easy. Designed for usage with async and await ()
  • Fast. Ultra high performance (even JSON parsing is opt-in).
  • Micro. The whole project is ~100 lines of code.
  • Agile. Super easy deployment and containerization.
  • Simple. Oriented for single purpose modules (function).
  • Explicit. No middleware. Modules declare all dependencies.
  • Standard. Just HTTP!

Example

The following example sleep.js will wait before responding (without blocking!)

import { send } from 'micro';import sleep from 'then-sleep';export default async function (req, res) {  await sleep(500);  send(res, 200, 'Ready!');}

To run the microservice on port 3000, use the micro command:

$ micro -p 3000 sleep.js

点评

  • 技术栈比较潮,es7的async/await,性能会很好
  • 遵循node的小而美哲学
  • 文档,测试,代码都比较规范

在微服务架构的潮流里,是一个不错的选择

全文完

欢迎关注我的公众号【node全栈】

node全栈.png

如果想参与评论,请点击原文链接,进入国内最专业的cnode论坛

转载于:https://my.oschina.net/nodeonly/blog/611878

你可能感兴趣的文章
iphone-common-codes-ccteam源代码 CCNSPredicate.m
查看>>
这次项目中应该注意的问题和应该保持的好习惯
查看>>
python-数据结构化与保存
查看>>
LeetCode - 551. Student Attendance Record I
查看>>
Java用户线程和守护线程
查看>>
ClassLoader类加载机制&&JVM内存管理
查看>>
Caml语句 查询分配给当前用户及当前组
查看>>
记一次源码分析
查看>>
php版本引起的const问题
查看>>
js实现60s倒计时效果
查看>>
【POJ 2176】Folding
查看>>
redis的过期策略以及内存淘汰机制
查看>>
阿牛的EOF牛肉串
查看>>
随笔2013/2/13
查看>>
笨办法32循环和列表
查看>>
java序列化
查看>>
谈谈NITE 2的第一个程序HandViewer
查看>>
VS2008 未响应 假死
查看>>
html5、css3及响应式设计入门
查看>>
Win10還原成最乾淨的狀態
查看>>