提交 5456d810e84b73cb48b7477fefa274abfb3b1865

作者 Nick Baugh
1 个父辈 3eb5cd7a

Release 0.0.4-rc.2

@@ -35,6 +35,12 @@ exports = module.exports = function(logger, settings) { @@ -35,6 +35,12 @@ exports = module.exports = function(logger, settings) {
35 // set error type 35 // set error type
36 error.type = res.statusCode < 500 ? 'invalid_request_error' : 'api_error' 36 error.type = res.statusCode < 500 ? 'invalid_request_error' : 'api_error'
37 37
  38 + if (_.isString(err.param)) {
  39 + error.type = 'invalid_request_error'
  40 + if (res.statusCode === 500)
  41 + res.statusCode = 400
  42 + }
  43 +
38 /* 44 /*
39 error.type = _.isString(err.param) ? 'invalid_request_error' : 'api_error' 45 error.type = _.isString(err.param) ? 'invalid_request_error' : 'api_error'
40 46
  1 +
  2 +// # boot - knex
  3 +
  4 +var knex = require('knex')
  5 +
  6 +exports = module.exports = function(logger, settings) {
  7 + return knex(settings.knex)
  8 +}
  9 +
  10 +exports['@singleton'] = true
  11 +exports['@require'] = [ 'igloo/logger', 'igloo/settings' ]
1 1
2 -// # boot - db 2 +// # boot - mongo
3 3
4 var mongoose = require('mongoose') 4 var mongoose = require('mongoose')
5 var _ = require('underscore') 5 var _ = require('underscore')
1 { 1 {
2 "name": "igloo", 2 "name": "igloo",
3 - "version": "0.0.4-rc.1", 3 + "version": "0.0.4-rc.2",
4 "description": "Igloo is a lightweight, fast, and minimal framework for rapid development", 4 "description": "Igloo is a lightweight, fast, and minimal framework for rapid development",
5 "main": "./lib", 5 "main": "./lib",
6 "repository": { 6 "repository": {
@@ -19,8 +19,10 @@ @@ -19,8 +19,10 @@
19 "commander": "^2.2.0", 19 "commander": "^2.2.0",
20 "connect-redis": "~2.0.0", 20 "connect-redis": "~2.0.0",
21 "express-session": "^1.2.1", 21 "express-session": "^1.2.1",
  22 + "knex": "^0.6.13",
22 "merge-defaults": "^0.1.0", 23 "merge-defaults": "^0.1.0",
23 "mongoose": "~3.8.7", 24 "mongoose": "~3.8.7",
  25 + "mysql": "^2.3.2",
24 "to-camel-case": "^0.2.1", 26 "to-camel-case": "^0.2.1",
25 "underscore": "~1.6.0", 27 "underscore": "~1.6.0",
26 "update-notifier": "git://github.com/niftylettuce/update-notifier", 28 "update-notifier": "git://github.com/niftylettuce/update-notifier",
注册登录 后发表评论