express icon indicating copy to clipboard operation
express copied to clipboard

Issue #4788 - ESM Module Example

Open Segmentational opened this issue 2 years ago • 2 comments

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 avatar Jan 25 '22 07:01 Segmentational

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

Segmentational avatar Jan 25 '22 07:01 Segmentational

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

Segmentational avatar Jan 25 '22 07:01 Segmentational