Git Product home page Git Product logo

bold's People

Contributors

alexprice1 avatar brandoncopley avatar kjprice avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kjprice

bold's Issues

Definition of mongoUri

I see that mongoUri is required for the config file. Where is this consumed in the api? I cannot find a reference to it.

Also, can this property optionally be a function, similar to cookieKey so that we can have a separate mongoUri for different environments?

schema modules should export schemas

One thing that I came across is that it appears the we have Bold.schemas actually expecting to hold instances of mongo models.

It might make sense to create another directory config/model that will simply create models from the given schemas.

config/model/user.js example

var Connection = require('bold').Connection;
var userSchema = require('../schema/user');

module.exports = Connection.model('User', userSchema);

config/schema/user.js example

var mongoose = require('mongoose');

var User = new Schema({});

module.exports = User;

This becomes more important later when we need to access the UserSchema.

I will do this in a pull request, but "internal" connectionType appears to not be occurring anymore

Changing function middleWare to this fixes.

function middleWare(args, count, data, fn, session, extras) {
if (count + 1 != args.length) {
args[count](data, fn, session, extras, function%28%29 {
middleWare%28args, count + 1, data, fn, session, extras%29;
}, fn);
} else {

if(!extras){
  extras = {};
}

if (!extras.connectionType && typeof extras === 'object') {
  extras.connectionType = 'internal';
}

args[count](data, fn, session, extras);

}
}

Routes directory instead of routes.js

With enterprise-size applications it often makes sense to split your routes between multiple files (users, settings, etc). Currently all routes must be housed within /config/routes.js. Similarly to how we iterate over all files within the /config/model/ directory, we can iterate over a new directory /config/routes/ to create our application's routes.

The naming convention of the files within /config/routes/ is not so important as only the function that is exported will be used. However, we can encourage users to include a /config/routes/index.js file if they do not want to create multiple files.

Global install cannot find "model" folder

I just tried to bold create myProject, then npm install, then node server. I am getting the error

Error: ENOENT: no such file or directory, scandir '~myProject/config/model' ... at requireFiles (...node_modules/bold/lib/bold.js:301:18)

This is due to changing the directory from "schema" to "model". bold create should create a model folder instead of a schema folder.

Check for config.useStaticServer or config.publicDirectory

I think that if config.publicDirectory is defined, than we can assume that the user wants to use static content. So instead of

if (config.useStaticServer != undefined) {

This could work:

if (config.useStaticServer != undefined || config.publicDirectory) {

helpers.js

It appears novation-mobile requires helpers.js - is this necessary?

Syntax error in JSON should send down 400 error

When doing a post request as such:

{"number"1}
instead of {"number":1}
Crazy long string gets thrown back to the client:

SyntaxError: Unexpected number
at Object.parse (native)
at parse (/Users/brandoncopley/github/default-server/node_modules/novation-mobile/node_modules/body-parser/index.js:64:17)
at /Users/brandoncopley/github/default-server/node_modules/novation-mobile/node_modules/body-parser/index.js:174:18
at IncomingMessage.onEnd (/Users/brandoncopley/github/default-server/node_modules/novation-mobile/node_modules/body-parser/node_modules/raw-body/index.js:117:7)
at IncomingMessage.g (events.js:180:16)
at IncomingMessage. (/Users/brandoncopley/github/default-server/node_modules/newrelic/node_modules/continuation-local-storage/context.js:76:17)
at IncomingMessage.emit (events.js:117:20)
at IncomingMessage.emitted as emit
at _stream_readable.js:929:16
at /Users/brandoncopley/github/default-server/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:177:31

Redundant folder

It looks like the folder /bold-server/ is the same thing as /example/. I propose dropping /bold-server/.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.