micro is a small module that makes it easy to write high performance and asynchronous microservices in Node.js. This video will introduce you to micro by building a tiny service that responds to all requests.
const {send} = require('micro');const sleep = require('then-sleep');// Just send methodmodule.exports = (req, res) => { send(res, 200, 'Hello World!')}// Just use returnmodule.exports = (req, res) => { return 'Hello World return';}// Easy to use async awaitmodule.exports = async function(req, res){ await sleep(5000) send(res, 200, 'Ready!')}