Getting started with KoaJs
May 22, 2021
Koa is a new web framework that is provided for creating web applications and APIs. And also this is more powerful and more expressive as well as it allows you to handle callbacks and errors.
Installation
You need to install node v7.6.0 or higher for ES2015 and async function support.
try these codes with your cmd
1) nvm install 7
2) npm i koa
3) node my-koa-app.js
Application
The obligatory My First App application
const Koa = require('koa');
const app = new Koa();
app.use(async ctx => {
ctx.body = 'My First App';
});app.listen(3000);
now you can run the program and see the “my first app” on localhost:3000