Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koa-gen

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-gen - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

package.json
{
"name": "koa-gen",
"version": "1.2.0",
"version": "1.2.1",
"description": "Koa' application generator for Koa v1.x and v2.x",

@@ -5,0 +5,0 @@ "main": "bin/koa",

@@ -49,2 +49,3 @@ # koa-generator

-1, --koa1 use Koa v1.x (defaults to Koa v2.x)
-b, --babel use babel for Koa v2.x
-e, --ejs add ejs engine support (defaults to jade)

@@ -51,0 +52,0 @@ --hbs add handlebars engine support

@@ -13,3 +13,8 @@ const app = require('koa')()

// global middlewares
// middlewares
app.use(require('koa-bodyparser')())
app.use(json())
app.use(log4js.koaLogger(log4js.getLogger('http'), { level: 'auto' }))
// setup view
app.use(views('views', {

@@ -19,8 +24,7 @@ root: path.join(__dirname, 'views'),

}))
app.use(require('koa-bodyparser')())
app.use(json())
app.use(log4js.koaLogger(log4js.getLogger('http'), { level: 'auto' }))
// handle error
onerror(app)
// logger
app.use(function *(next) {

@@ -41,3 +45,5 @@ var start = new Date()

app.use(koa.routes())
.use(router.allowedMethods())
// log error
app.on('error', function (err, ctx) {

@@ -44,0 +50,0 @@ logger.error('server error', err, ctx)

@@ -22,4 +22,6 @@ const Koa = require('koa')

// handle error
onerror(app)
// setup view
app.use(views(__dirname + '/views', {

@@ -43,8 +45,11 @@ extension: '{views}'

// routes definition
router.use('/', index.routes(), index.allowedMethods())
router.use('/users', users.routes(), users.allowedMethods())
app.use(router.routes(), router.allowedMethods())
// response
// mount root routes
app.use(router.routes())
.use(router.allowedMethods())
// log error
app.on('error', function (err, ctx) {

@@ -51,0 +56,0 @@ logger.error(err)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc