ansble / monument Goto Github PK
View Code? Open in Web Editor NEWevent based http server for nodejs
Home Page: http://monument.ansble.com
License: MIT License
event based http server for nodejs
Home Page: http://monument.ansble.com
License: MIT License
what the title says...
Make this configurable but on by default
See helmetjs for some implementation details
Should say monument instead of monumentjs
make sure it works here as well as in nodejs
think express generator
and hopefully functions the same way as the back end, sharing as much of the routing code as possible.
make this thing work in a nice npm package.
when you use .send the etag generation gets unhappy about empty arrays []
make this work!
Yep.
configurable in the config object... I need to read some more about it to know if it should be on by default. I would guess that it should.
See helmet hpkp, an mdn article, the spec it is based on, and a tutorial
This is a pivotal decision... the code is super simple and could probably go either way... but which way to take it. Discussion and thoughts will happen here for openness and to document direction for future development
sometimes... not sure why
requires that everything be on https instead of http
see helmet hsts
Flag on init for the server.
This has some pretty cool implications for isomorphic application development.
content security policy config and support into the config object.
Look at implementation in helmetjs
no query params!
otherwise somethings won't be able to support caching correctly.
and it makes pagespeed and yslow sad
hide powered by header by default but allow a header to be passed. Alternately it can be explicitly turned on with a true config value.
server
http
https
web
webserver
web server
framework
api
app
rest
restful
Make lots of documentation.
One item that needs to be documented is the setMaxListener that flags based on process.env.NODE_ENV = production
. More details here about setting that correctly on heroku.
Also need to document best practice of resource aggregation instead of request aggregation.
Would be nice to have a good solid article about maintaining encapsulation in code through events for data etc..
set to on by default and configurable in the config object to off
see helmet
Like a res.send()
method.
see helmet
handle sending appropriate headers based on queries from browsers (304, 200) and include long cache headers in the header of responses. Make it configurable so that it can be set easily somewhere.
On by default but configurable to off
see helmet
gets:
/Users/designfrontier/projects/dfRedesign/node_modules/monument/utils/send.js:15
that.setEncoding(encoding); //encoding header for the response
^
TypeError: undefined is not a function
at ServerResponse.send (/Users/designfrontier/projects/dfRedesign/node_modules/monument/utils/send.js:15:9)
at EventEmitter.<anonymous> (/Users/designfrontier/projects/dfRedesign/routes/main.js:17:18)
at EventEmitter.g (events.js:199:16)
at EventEmitter.emit (events.js:107:17)
at EventEmitter.<anonymous> (/Users/designfrontier/projects/dfRedesign/data/articles.js:465:10)
at EventEmitter.emit (events.js:107:17)
at EventEmitter.<anonymous> (/Users/designfrontier/projects/dfRedesign/routes/main.js:20:9)
at EventEmitter.emit (events.js:107:17)
at Server.<anonymous> (/Users/designfrontier/projects/dfRedesign/node_modules/monument/routes/index.js:253:11)
at Server.emit (events.js:110:17)
For instance, one might want to execute the same view function for all requests to /users/<id>
.
Currently, no event would fire for /users/1234
because there is no way to identify patterns.
should be stored at req.body for POST, PUT, UPDATE, etc. and be an object
There is some wackiness here... rewrite to use own event system instead of built in events.emitter.
There is a convention where parameter keys are suffix with []
indicating multiple values are expected. Monument should handle this convention elegantly. @eatrocks is currently working on a pull request addressing this.
on by default config to off with false
see helmet
Needs to be something like what we have in actionjs. should allow multiple events to trigger before it does something.
make sure that the check for compression on line 208 of /routes/index.js verifies that the header exists. either at line 208 or in the getCompression [line 131] function. Also look at simplifying the getCompression function.
This causes the app to crash when a client without headers requests a page. And then boom.
output from crash:
2015-03-11T16:50:31.739795+00:00 heroku[web.1]: State changed from starting to up
2015-03-11T16:50:32.051283+00:00 app[web.1]: /app/node_modules/newrelic/lib/transaction/tracer/index.js:158
2015-03-11T16:50:32.051290+00:00 app[web.1]: throw err
2015-03-11T16:50:32.051292+00:00 app[web.1]: ^
2015-03-11T16:50:32.051297+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/monument/routes/index.js:208:22)
2015-03-11T16:50:32.051304+00:00 app[web.1]: at Array.forEach (native)
2015-03-11T16:50:32.075881+00:00 app[web.1]: npm ERR! Linux 3.13.0-40-generic
2015-03-11T16:50:32.051299+00:00 app[web.1]: at stateCheck (/app/node_modules/monument/node_modules/event-state/app.js:46:15)
2015-03-11T16:50:32.051301+00:00 app[web.1]: at Object.call (/app/node_modules/monument/node_modules/event-state/app.js:32:6)
2015-03-11T16:50:32.051302+00:00 app[web.1]: at /app/node_modules/monument/emitter.js:15:31
2015-03-11T16:50:32.051295+00:00 app[web.1]: at getCompression (/app/node_modules/monument/routes/index.js:135:24)
2015-03-11T16:50:32.051307+00:00 app[web.1]: at /app/node_modules/monument/utils/staticFileEtags.js:15:11
2015-03-11T16:50:32.051305+00:00 app[web.1]: at Object.emitter.emit (/app/node_modules/monument/emitter.js:11:25)
2015-03-11T16:50:32.051310+00:00 app[web.1]: at wrapped (/app/node_modules/newrelic/lib/transaction/tracer/index.js:155:28)
2015-03-11T16:50:32.051308+00:00 app[web.1]: at wrappedCallback (/app/node_modules/newrelic/lib/transaction/tracer/index.js:260:17)
2015-03-11T16:50:32.071760+00:00 app[web.1]:
2015-03-11T16:50:32.083993+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2015-03-11T16:50:32.051293+00:00 app[web.1]: TypeError: Cannot read property 'split' of undefined
2015-03-11T16:50:32.076389+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2015-03-11T16:50:32.076642+00:00 app[web.1]: npm ERR! node v0.12.0
2015-03-11T16:50:32.077445+00:00 app[web.1]: npm ERR! npm v2.5.1
2015-03-11T16:50:32.077639+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2015-03-11T16:50:32.077837+00:00 app[web.1]: npm ERR! [email protected] start: `node app.js`
2015-03-11T16:50:32.077987+00:00 app[web.1]: npm ERR! Exit status 1
2015-03-11T16:50:32.078168+00:00 app[web.1]: npm ERR!
2015-03-11T16:50:32.078325+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script 'node app.js'.
2015-03-11T16:50:32.078504+00:00 app[web.1]: npm ERR! This is most likely a problem with the designfrontier-website package,
2015-03-11T16:50:32.082896+00:00 app[web.1]:
2015-03-11T16:50:32.079253+00:00 app[web.1]: npm ERR! npm owner ls designfrontier-website
2015-03-11T16:50:32.079412+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2015-03-11T16:50:32.083830+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2015-03-11T16:50:32.078664+00:00 app[web.1]: npm ERR! not with npm itself.
2015-03-11T16:50:32.078808+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2015-03-11T16:50:32.078956+00:00 app[web.1]: npm ERR! node app.js
2015-03-11T16:50:32.079107+00:00 app[web.1]: npm ERR! You can get their info via:
2015-03-11T16:50:32.069550+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/components/navigation/navigation.js" host=www.designfrontier.net request_id=7beb108a-5d21-4b05-9d9f-411e269f5c75 fwd="220.181.108.159" dyno=web.1 connect=1ms service=45ms status=503 bytes=0
2015-03-11T16:50:33.048418+00:00 heroku[web.1]: Process exited with status 1
2015-03-11T16:50:33.058097+00:00 heroku[web.1]: State changed from up to crashed
should not send back anything... also should be allowed by default on all routes.
Otherwise it gets weird because of the file system cache for them... or turn off compression in dev.
Remove any reference to monumentjs
and replace with just monument
after the rename I missed a few...
make the trailing slash optional on all routes. Makes everyone's life easier.
What the title says... This should definitely be added for static files, and potentially for dynamic files depending on performance. Maybe that option should be behind a flag...
Default configuration for dotjs.strip is true which was causing a Uncaught SyntaxError: Unexpected end of input
error. When set to false, the error went away. There doesn't seem to be a way to change the configuration while using monument.
highlight new features and bug fixes etc.
They are less then functionally pure now... might be nice to make them a bit more pure. Maybe the connection object has a .body, .params, and .query on it instead of on the request. things to explore
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.