Comments (6)
To get the point of csrf across, you should only use modules that are relevant to show how csrf works. The example on the csrf-lite readme only uses 3 modules.
from http-framework.
I guess it depends what you're trying to demonstrate. It seems to me like examples with lots of dependencies are as you would probably find them in production, which is valuable in one sense, but also confuses the demonstration of a particular concept. For example routes-router isn't necessary in an example demonstrating csrf, but you would probably find a router in a production server. It could be worth having both a light demonstration of a feature and a working production-ready example implementation to go alongside it.
from http-framework.
So I have put a lighter example of csrf-lite
in the README.
I think the README documentation should have light examples.
I feel like its nice to have a "production-ready" set of examples in the examples folder but im still curious whether or not I'm going too far.
from http-framework.
More generally, most of these examples are way too heavy in furtherance of feature parity with existing featuresets provided by frameworks like express, which misses the point of using tiny modules in the first place. Tiny modules are easy to wrap your head around and you can drop them into an application incrementally as you build it.
So for example, the auth example at https://github.com/Raynos/http-framework/blob/master/examples/auth/server.js is really gigantic because it has feature parity with some existing express example, but that's not a good survey of the multitude of approaches in solution space. For example, if you take on a different set of trade-offs for doing auth you might end up with something like the persona-id example which is pretty tiny and even includes all the browser code necessary.
I think this collection of examples would be much more convincing if the lines of code present were severely limited and abstracted into modules that encapsulate the roles of multiple related modules more. You can do that with modules and you can always take a step back to use the primitives that the higher-level modules are depending on but you can do it piecemeal when you need to.
from http-framework.
@substack that's an interesting viewpoint. See, when I came across this "feature parity" you mention, I presumed it was intentional. Like, you can achieve what express achieves just without express. To me it would seem like you would need feature parity to make that assertion. I don't think http-framework should be striving to make that assertion, but it feels like it is because it has "example partity", if you want to call it that, with competing frameworks. I presume if we set out to prove that you can do everything express does then then we actually have no quarrel with what express does and how it achieves it, and we were only simply misaligned on some feeling of modular composition. It is indeed a more powerful notion to stay true to the essence of the small modules when promoting the modular approach and to reject the need to do what express does.
from http-framework.
@substack does that conflict with #2 ?
the examples show how to glue multiple modules together to do generic web cruddy stuff. Like having password solution, sessions, forms, session messages on POST REDIRECT GET is a useful example of a generic web cruddy thing.
Maybe we should have a persona-id example as well?
I do want to demonstrate you can do everything. the current approach is porting existing demonstrations of everything. I dont know what all the webby things you might want to do are. I'm using other frameworks for examples.
from http-framework.
Related Issues (20)
- feedback on mvc example HOT 3
- Modules wiki backlog
- move modules to a `modules` folder to reduce clutter HOT 1
- Write tests for examples
- Multipart-form example needs improving/supplementing HOT 1
- Add primus modules to wiki & bla
- demonstrate everything
- Serving up templates HOT 1
- There should be some more indepth tutorials. HOT 1
- Parsing received data HOT 2
- add auth example using oauth(1|1A|2) HOT 1
- support multiple templates HOT 1
- Update examples to use http-hash-router HOT 4
- Don't use <string>.length for Content-Length headers HOT 2
- security HOT 3
- default templates HOT 3
- Demonstrate `error-page` HOT 2
- Add browserify example
- Do multipart form demo HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-framework.