Skip to content

Conversation

@Segmentational
Copy link

@Segmentational Segmentational commented Jan 25, 2022

It's getting incredibly late here, but I mocked up a quick example that demonstrates how to use express via an ESM module. I've been using ECMA modules for a little while now, and can include a much more complex example upon request. There's a bit of power using modules vs. the CommonJS approach. Imho, as an example, it's a bit easier to add middleware. There's a lot of ease, too, when using async.

However, express@^5 is required. I believe this has to do with the impressive compatibility express has kept with the various node versions.

@Segmentational
Copy link
Author

Whoops, I forgot to mention Issue #4788. I'll include a link back to this there, too.

@Segmentational
Copy link
Author

Note -- this was ran on the latest LTS version of Node.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants