examples
examples copied to clipboard
wishlist: Express examples
It would be genuinely wonderful to get some examples of Express into the examples repo's servers examples.
Ideally, these examples will:
- Go beyond a simple "Hello, World"
- Include tests
- Have a README that explains what the project does and how to use it.
Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️
I am happy to contribute here.
Yay! If you have any questions @gireeshpunathil, more than happy to do what I can to help get you going 👍
to start with, here is what I think the app could contain:
- a (GET) route which yields a simple response such as the current time in UTC
- a (GET) route which is enabled with session
- a (POST) route that runs a file upload function
- a (GET) route which fetches and process some data from some db
- a (GET) route that forwards the request to another route
and some tests. let me know WDYT!
that sounds good to me, though I'm not sure if fetching data from a database is meaningfully testable in CI. More than happy to be wrong!
my idea was to look for an in-memory db for this purpose: while not making things too complex, and still caters to a very common programming scenario.
sounds good to me :)
Maybe it would be worth to include examples in other frameworks (like Koa or Nest) as well as a server in pure Node.js just to show the difference and pros/cons of each approach?
I believe there could be some situations where using pure Node would make a perfect sense. What do you think?
@iandrc The intent of this repository is to include many different kinds of examples. I'd look at it less as a pros/cons comparison and more of a way to demonstrate how things work in general. Ideally, with enough examples, the similarities and differences could be figured out by reading/running those difference examples.
I've got some working examples with mongodb and mysql2. Sorry late to party here and very new too contributing altogether.