Skip to content
Permalink
a8fdbf4ca9
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
37 lines (29 sloc) 714 Bytes
'use strict'
require('dotenv').config()
const Koa = require('koa')
const views = require('koa-views')
//temp
const stat = require('koa-static')
const koaBody = require('koa-body')
//
const Router = require('./core/routes')
const app = new Koa()
const port = process.env.SERVER_PORT
//temp
app.use(stat('public'))
app.use(koaBody())
//
app.use(views(`${__dirname}/core/views`,
{
extension: 'hbs',
options: {
partials: {
header: `${__dirname}/core/views/partials/header`,
footer: `${__dirname}/core/views/partials/footer`
}
},
map: { hbs: 'handlebars' }
}))
app.use(Router.routes())
app.use(Router.allowedMethods())
app.listen(port, () => console.log(`Server running on ${port}...`))