alexprice1 / bold Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
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?
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.
var Connection = require('bold').Connection;
var userSchema = require('../schema/user');
module.exports = Connection.model('User', userSchema);
var mongoose = require('mongoose');
var User = new Schema({});
module.exports = User;
This becomes more important later when we need to access the UserSchema.
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);
}
}
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.
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.
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) {
function getApi(method, api) {
var This = this;
This.api = api;
This.method = method;
return function(data, fn, session, extras) {
var api = This.api(data, fn, session, extras);
var args = [];
for (var i in arguments) {
args.push(arguments[i]);
}
return api[This.method].apply(undefined, args);
}
}
On the README, can we have an example of how a session is created?
It appears novation-mobile requires helpers.js - is this necessary?
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
It looks like the folder /bold-server/ is the same thing as /example/. I propose dropping /bold-server/.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.