提交 5456d810e84b73cb48b7477fefa274abfb3b1865

作者 Nick Baugh
1 个父辈 3eb5cd7a

Release 0.0.4-rc.2

... ... @@ -35,6 +35,12 @@ exports = module.exports = function(logger, settings) {
35 35 // set error type
36 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 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 4 var mongoose = require('mongoose')
5 5 var _ = require('underscore')
... ...
1 1 {
2 2 "name": "igloo",
3   - "version": "0.0.4-rc.1",
  3 + "version": "0.0.4-rc.2",
4 4 "description": "Igloo is a lightweight, fast, and minimal framework for rapid development",
5 5 "main": "./lib",
6 6 "repository": {
... ... @@ -19,8 +19,10 @@
19 19 "commander": "^2.2.0",
20 20 "connect-redis": "~2.0.0",
21 21 "express-session": "^1.2.1",
  22 + "knex": "^0.6.13",
22 23 "merge-defaults": "^0.1.0",
23 24 "mongoose": "~3.8.7",
  25 + "mysql": "^2.3.2",
24 26 "to-camel-case": "^0.2.1",
25 27 "underscore": "~1.6.0",
26 28 "update-notifier": "git://github.com/niftylettuce/update-notifier",
... ...
注册登录 后发表评论