const Koa = require('koa'),
Router = require('koa-router'),
logger = require('koa-logger'),
views = require('koa-views'),
bodyParser = require('koa-bodyparser'),
app = new Koa(),
router = new Router();
app.use(logger());
app.use(bodyParser());
app.use(views(__dirname, {extension: 'html'}));
router.get('/', async (ctx) => {
await ctx.render('index', {title: 'Авторизация'});
});
app.use(router.routes());
app.listen(3001);
<h1>Hello</h1>
├── koa@2.4.1
├── koa-bodyparser@4.2.0
├── koa-logger@3.1.0
├── koa-router@7.3.0
└── koa-views@6.1.2
exports.HelloWorld;