Skip to content
Permalink
4b6ef20121
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 18 lines (13 sloc) 511 Bytes
#!/usr/bin/env node
const Koa = require('koa')
const Router = require('koa-router')
const views = require('koa-views')
const stat = require('koa-static')
const app = new Koa()
const router = new Router()
app.use(stat('public'))
app.use(views(`${__dirname}/views`, { extension: 'html' }, {map: { handlebars: 'handlebars' }}))
app.use(router.routes())
const port = 8080
router.get('/', async ctx => await ctx.render('hello'))
module.exports = app.listen(port, () => console.log(`listening on port ${port}`))