Author here. I was getting tired of having to do the same thing again and again, both in my personal projects and when teaching people Node.js. So I created server.js a layer above express with three main differences:
- Opinionated: things work by default by having an opinion on how to make them work. They can be easily deactivated or changed with any of express' middleware or writing your own thing. Strong opinions loosely held.
- Minimal: less boilerplate code, more fun! I was inspired by lodash (vs underscore) philosophy. You can just do require('server/router') and it is native to the recently added async in Node.js. Forget about callback hell with server.js.
- Sockets [upcoming]: Websockets are the revolution that never happened, IMO because of the complexity of setting them up. As the creator of server I also bundled socket.io for great websockets support. Now they are just one more route socket('message', middleware).
I'd love your feedback on the library. It is not intended to be a super-new-cool-fashionable library, but instead to make developing Node.js websites more pleasant. Please don't hype it, just be quietly super-productive with it and help me improve the rough edges where needed.
PS, there are two great features coming officially on the 1.1 release, websockets and plugins. Both are kind-of working already, but due to the amount of work needed to make them ready for production I decided to split them into a separated release. Cannot promise a release date though, but probably sooner than expected.
How does the router really work? Large apps often have hundreds of paths with nested/sub/sub/sub/resources. Is it possible to declare subresource path without specifying the parent resource path?
2 comments
[ 0.31 ms ] story [ 15.7 ms ] thread- Opinionated: things work by default by having an opinion on how to make them work. They can be easily deactivated or changed with any of express' middleware or writing your own thing. Strong opinions loosely held.
- Minimal: less boilerplate code, more fun! I was inspired by lodash (vs underscore) philosophy. You can just do require('server/router') and it is native to the recently added async in Node.js. Forget about callback hell with server.js.
- Sockets [upcoming]: Websockets are the revolution that never happened, IMO because of the complexity of setting them up. As the creator of server I also bundled socket.io for great websockets support. Now they are just one more route socket('message', middleware).
I'd love your feedback on the library. It is not intended to be a super-new-cool-fashionable library, but instead to make developing Node.js websites more pleasant. Please don't hype it, just be quietly super-productive with it and help me improve the rough edges where needed.
PS, there are two great features coming officially on the 1.1 release, websockets and plugins. Both are kind-of working already, but due to the amount of work needed to make them ready for production I decided to split them into a separated release. Cannot promise a release date though, but probably sooner than expected.