Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

wishlist: Express examples #10

Open
bnb opened this issue Jul 7, 2020 · 9 comments · May be fixed by #21
Open

wishlist: Express examples #10

bnb opened this issue Jul 7, 2020 · 9 comments · May be fixed by #21
Assignees
Labels

Comments

@bnb
Copy link
Contributor

bnb commented Jul 7, 2020

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 ❤️

@bnb bnb added the wishlist label Jul 7, 2020
@gireeshpunathil
Copy link
Member

I am happy to contribute here.

@bnb
Copy link
Contributor Author

bnb commented Jul 8, 2020

Yay! If you have any questions @gireeshpunathil, more than happy to do what I can to help get you going 👍

@gireeshpunathil
Copy link
Member

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!

@bnb
Copy link
Contributor Author

bnb commented Jul 9, 2020

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!

@gireeshpunathil
Copy link
Member

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.

@bnb
Copy link
Contributor Author

bnb commented Jul 10, 2020

sounds good to me :)

@ghost
Copy link

ghost commented Jul 13, 2020

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?

@bnb
Copy link
Contributor Author

bnb commented Jul 13, 2020

@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.

@gireeshpunathil gireeshpunathil linked a pull request Jul 17, 2020 that will close this issue
@trevatk
Copy link

trevatk commented Oct 12, 2020

I've got some working examples with mongodb and mysql2. Sorry late to party here and very new too contributing altogether.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants