carbon-io / carbond Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Allow config or possibly generate examples for schemas. first just allow static examples?
Also think about 204
http://blog.ploeh.dk/2013/04/30/rest-lesson-learned-avoid-204-responses/
Something like
{
middleware: [
function(req, res, next) {},
function(req, res, next) {},
...
]
}
node cluster support is enabled when passing the --cluster
flag. the number of worker processes started defaults to the number of CPUs present and is configurable with the --num-cluster-workers
option.
what other options do we need? do we want the master to automatically restart workers? do we want to have a command line flag to control this?
When using a _type: MongoDBCollection, parameters "sort", "field", "skip", and "limit" do not seem to get sent along with the query from the objectserver:
URL (GET) sent to carbon server and resulting log line (no ntoreturn, returns all documents with {"published": true}):
http://localhost:8885/events?query={"published":true}&limit=1
2016-06-02T15:41:18.140-0700 I COMMAND [conn386] command mongolab-status.public-status-events command: find { find: "public-status-events", filter: { published: true }, projection: {} } planSummary: COLLSCAN keysExamined:0 docsExamined:3 cursorExhausted:1 keyUpdates:0 writeConflicts:0 numYields:0 nreturned:2 reslen:758 locks:{ Global: { acquireCount: { r: 2 } }, MMAPV1Journal: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { R: 1 } } } protocol:op_query 0ms
shell command and resulting log line (ntoreturn is 1, returns 1 document):
db['public-status-events'].find().limit(1)
2016-06-02T14:41:06.736-0700 I QUERY [conn392] query mongolab-status.public-status-events planSummary: COLLSCAN ntoreturn:1 ntoskip:0 keysExamined:0 docsExamined:1 cursorExhausted:1 keyUpdates:0 writeConflicts:0 numYields:0 nreturned:1 reslen:395 locks:{ Global: { acquireCount: { r: 2 } }, MMAPV1Journal: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { R: 1 } } } 0ms
Also look into what exit codes should be (ie. 128 plus signal).
http://stackoverflow.com/questions/1101957/are-there-any-standard-exit-status-codes-in-linux
1 Catchall for general errors
2 Misuse of shell builtins (according to Bash documentation)
126 Command invoked cannot execute
127 "command not found"
128 Invalid argument to exit
128+n Fatal error signal "n"
130 Script terminated by Control-C
255 Exit status out of range
has to be replaced. Used in a few places
_C: function() {
this.parameters = {}
this._allParameters = null // cache of all parameters including inherited parameters
this.responseSchema = undefined
this.errorResponses = undefined
this.objectserver = null
this.endpoint = null
},
Or is this confusing?
and uncomment stuff
In swagger ui if you do an obj get with no id the request url is:
http://Wills-MacBook-Pro.local:8888/zipcodes/{id})
Invalid json sent in body fails body parser in non-friendly way.
Should be able to get message out to client but we get this. Should re-test on latest Node.js
SyntaxError: Unexpected string
at Object.parse (native)
at parse (/Users/will/src/github/carbon-io/carbond/node_modules/body-parser/lib/types/json.js:84:17)
at /Users/will/src/github/carbon-io/carbond/node_modules/body-parser/lib/read.js:102:18
at IncomingMessage.onEnd (/Users/will/src/github/carbon-io/carbond/node_modules/body-parser/node_modules/raw-body/index.js:149:7)
at IncomingMessage.g (events.js:180:16)
at IncomingMessage.EventEmitter.emit (events.js:92:17)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
When omitting .toArray() from a find() call against a carbon.carbond.collections.Collection, the error is the following:
[Fri Jun 03 2016 11:30:44 GMT-0700 (PDT)] ERROR: TypeError: Converting circular structure to JSON
at Object.stringify (native)
appears to come from JSON.stringify()
Given we want to support EJSON?
Right now we can't return undefined from an operation. It causes a hang given the way we detect sync vs async in ObjectServer.js. Is there a way to tell if the response has been written to that could help us change the logic around some?
Probably should be on Operation. Might not be right as they are with Collection given the flexibility of responses in Collections.
Do we support this and how does it related to Endpoint.allowUnauthenticated (which is an array of verbs)
Do we support this? If so need have a way to get at both the parameter and the raw value. Otherwise we should remove from code til we are ready to support.
Possibly rename www to public (for static files directory)
Request qs and querystring cause JSON query params to come out very
strange (to me :). Why do we need a new JSON syntax?
What we support -- what is configurable? Right now I think if we stringfy json on carbon client the server can support our style and what request puts out.
There is also security to consider. Certain serialization forms may have security implications.
i.e. de-support un-packed array syntax? We want to look carefully at JSON injection and how one can make objects without realizing it.
We also want to watch for method spoofing on Endpoint classes (must protect against invoking class methods that are not HTTP verbs -- should have unit test for this).
Firm up how they work
If you send non escaped params in query string server freaks
[15-04-26|14:03:56]% curl 'localhost:8888/hello?message="Nice "'
curl: (52) Empty reply from 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.