ericclemmons / polydev

Faster, route-centric development for Node.js apps with built-in Hot Module Replacement.
282 stars 6 forks source link

Production mode #4

Closed ericclemmons closed 5 years ago

ericclemmons commented 5 years ago

Simple

$ NODE_ENV=production polydev

Custom

const polydev = require('polydev')

express().use(polydev()).listen(3000)
ericclemmons commented 5 years ago

Half of this is done in 454fe9d.

The other half needs a custom test-script...

ericclemmons commented 5 years ago

I'm not sure what I want the exports to be.

I see value in having explicit middleware available like:

All of which are instantiated (e.g. routes("path/to/routes")) manually, or automatically when running polydev.

The downside of exporting polydev is that it makes it harder to introduce an API for it on the same name.

Maybe polydev/middleware is the way to go? (Although that has the same issue above, especially given some of the middleware is environment specific)