Skip to content

Production mode#4

Merged
ericclemmons merged 2 commits into
masterfrom
4-middleware
Jan 18, 2019
Merged

Production mode#4
ericclemmons merged 2 commits into
masterfrom
4-middleware

Conversation

@ericclemmons
Copy link
Copy Markdown
Owner

@ericclemmons ericclemmons commented Jan 18, 2019

Simple

$ NODE_ENV=production polydev

Custom

const polydev = require('polydev')

express().use(polydev()).listen(3000)

@ericclemmons
Copy link
Copy Markdown
Owner Author

Half of this is done in 454fe9d.

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

@ericclemmons
Copy link
Copy Markdown
Owner Author

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

I see value in having explicit middleware available like:

  • routes
  • assets
  • errors

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)

@ericclemmons ericclemmons merged commit e609a40 into master Jan 18, 2019
@ericclemmons ericclemmons added the enhancement New feature or request label Feb 3, 2019
ericclemmons added a commit that referenced this pull request Feb 3, 2019
## UNRELEASED

##### Pull Requests

- #19 - Support "-r" flags via child_process.fork/spawn? *(@ericclemmons)*
- #7 - TypeScript support *(@ericclemmons)*
#### Commits

- cd9f1f8 - yarn dev uses ts-node (@ericclemmons)
- 37c7a93 - @ts-ignore (@ericclemmons)
- 515d9e0 - Update README.md with updated args example (@ericclemmons)
- 4970d21 - polydev forks to server so we can re-use Node flags (@ericclemmons)
- aebd7ff - Add docs for TypeScript (@ericclemmons)
- 544e4cd - Routes support .ts (@ericclemmons)
- 9bad30f - Add typescript-example (@ericclemmons)
- 5c0f950 - typo (@ericclemmons)
- 7d4c0c2 - Put gif in blockquote (@ericclemmons)
- 087da74 - Use markdown for links (@ericclemmons)
- ecc0748 - Add demo gif (@ericclemmons)
## v1.2.0 (2019-01-17)

##### Pull Requests

- #10 - development/production-only routes *(@ericclemmons)*
- #4 - Production mode *(@ericclemmons)*
- #16 - Add shadow to logo *(@ericclemmons)*
#### Commits

- f478073 - In production, don't add routes if no handler is exported (@ericclemmons)
- b73c06b - In development, listen to non-exported servers so we at least 404 (@ericclemmons)
- 9bf29ab - Add /dev-only page (@ericclemmons)
- 62a81a5 - Add a standalone server.js via dev:server & start:server (@ericclemmons)
- 31052bb - Export { polydev} as a middleware (@ericclemmons)
- 0bd0883 - Add shadow to logo (@ericclemmons)
## v1.1.0 (2019-01-16)

##### Pull Requests

- #11 - Make assets available under _polydev *(@ericclemmons)*
- #12 - Empty repo experience *(@ericclemmons)*
#### Commits

- 698945d - Some quick documentation on how to use it (@ericclemmons)
- 8a7bbe3 - All polydev-specific styles are under /_polydev (@ericclemmons)
- 258c520 - Use path.join for potential path (@ericclemmons)
## v1.0.0 (2019-01-16)

#### Commits

- 056e990 - np --yolo (@ericclemmons)
- ae7eec5 - Revert "Move np dependency to root" (@ericclemmons)
- cab50b2 - Remove unlink on preinstall, since this can fail when the link doesn't exist (@ericclemmons)
- 9e99e2f - Move np dependency to root (@ericclemmons)
- 9a462af - Prepare for publishing (@ericclemmons)
- 04472dd - Start at v0.0.0 (@ericclemmons)
- 268cb66 - unlink before link (@ericclemmons)
- 9cad508 - Ignore dist (@ericclemmons)
- 254beec - Link Roadmap to GitHub issues (@ericclemmons)
- 66902b3 - Better README.md (@ericclemmons)
- f85b332 - Add /logo for capturing the logo (@ericclemmons)
- 02072a9 - Forward most of process.env to sub-processes (@ericclemmons)
- c26e4c5 - Fix reference to NODE_ENV (@ericclemmons)
- 7de772a - build next-example before starting (@ericclemmons)
- 454fe9d - production mode (@ericclemmons)
- e8f1431 - Enable notFound & error routes only in development (@ericclemmons)
- 183aa8e - Enable apollo-playground in production (@ericclemmons)
- 3376f87 - Remove esm (@ericclemmons)
- ed32470 - yarn dev & yarn start (@ericclemmons)
- 7bb3c61 - Prettier 404 page (@ericclemmons)
- f62bb5c - Fix bug with index.js not using both GET & POST (@ericclemmons)
- 659c58d - GraphQL doesn't need to use express explicitly (@ericclemmons)
- dc02fc5 - Routes are duplicated between polydev + launcher (so that express behaves the same) (@ericclemmons)
- 49ec7fe - Add better parameterized route example (@ericclemmons)
- 15a9c4c - No longer namespace routes automatically (we'll see) (@ericclemmons)
- d07edb4 - Prettier error page (@ericclemmons)
- f0854e4 - hot-module-replacement@^3.0.3 fixes Next.js (reverts f416636) (@ericclemmons)
- 7d79c3e - Add helpful postinstall + start scripts (@ericclemmons)
- f416636 - Use fork until new version is published with sidorares/hot-module-replacement#14 (@ericclemmons)
- aa8c2f3 - 500 error example (@ericclemmons)
- 2ddc216 - Interactive Next.js example (@ericclemmons)
- f57bb7d - Prettier Next.js example (@ericclemmons)
- 137b17c - Absolute path to /styles.css (@ericclemmons)
- 27d8a6a - Working SSE example! This means Next.js works too! (@ericclemmons)
- 27c37cd - whitespace (@ericclemmons)
- 1959a99 - SSE example (@ericclemmons)
- 5f53d1e - Revert "bridge returns a promise instead of talking to the process directly" (@ericclemmons)
- c08a9ff - Add notes for error page (@ericclemmons)
- 4ca11f8 - Remove polydev exports (@ericclemmons)
- 063f4c8 - Use body-parser for 404 page (@ericclemmons)
- c516b73 - Remove redundant variables (@ericclemmons)
- c78e02f - Switch to support index[.*|get|post].js (@ericclemmons)
- 65f7f55 - Routes only respond to GET/POST for now (@ericclemmons)
- f2e6704 - Enable built-in HMR only for functional routes (@ericclemmons)
- db7ad56 - Got pages returning from Next.js (@ericclemmons)
- 6af6705 - If a child process crashes, re-create it on the next request (@ericclemmons)
- 7f9471f - Revert 2080882 to prevent crashing the process (@ericclemmons)
- a829c90 - Working apollo-server example (@ericclemmons)
- deaefcf - Simpler child exists check (@ericclemmons)
- 2080882 - Remove process.on errors (@ericclemmons)
- c6b99bc - Add note for bug with HMR with servers (@ericclemmons)
- c6d65f8 - Fix regression with HMR not referencing the latest handler (@ericclemmons)
- bf68ccf - require("polydev").mount(handler) is good for relative routes (@ericclemmons)
- 99e5d30 - Move server to separate file (@ericclemmons)
- 0ffdc17 - Add hit counter to express example (@ericclemmons)
- b359156 - Fix background (@ericclemmons)
- e12e243 - Use font-size: 16px (@ericclemmons)
- 8b9c72e - bridge returns a promise instead of talking to the process directly (@ericclemmons)
- d0d5018 - Force arrow-parens (@ericclemmons)
- 42e81e5 - Double-save to restart server (@ericclemmons)
- 0543767 - hot-module-replace is legit! (@ericclemmons)
- 971fee3 - Remove form margins (@ericclemmons)
- ce415d8 - Add note about empty routes (@ericclemmons)
- b04ff3f - Create empty pages with _some_ content (@ericclemmons)
- 748c15b - Wait for the servers to start before finishing the request (@ericclemmons)
- efdd1e4 - Prettier 404 page (@ericclemmons)
- 45e6bc7 - Events are tied to their request/response via a UUID (@ericclemmons)
- 75b932b - 404 page lets you create the missing page (@ericclemmons)
- 35984d9 - Add Next.js example (@ericclemmons)
- 47bc36f - Faster fadeIn (@ericclemmons)
- fe9ebec - apollo-server 2 is terrible (@ericclemmons)
- 0668c60 - Add graphql-example (@ericclemmons)
- e7fb252 - Improved folder structure (@ericclemmons)
- 819c4fe - Only open window if --open (@ericclemmons)
- 9c7d769 - Use express internally (@ericclemmons)
- 721f034 - Add express-example (@ericclemmons)
- 6d4fa25 - Add 404 link (@ericclemmons)
- 1a5914c - Add (broken) apollo-server-example (@ericclemmons)
- 60d061c - Have a pretty example page (@ericclemmons)
- 7f4b0f4 - Support static assets (@ericclemmons)
- 14f793e - Add a better README.md (@ericclemmons)
- 41739c4 - Switch to yarn workspaces (@ericclemmons)
- 60b2349 - opn URL when the server starts (@ericclemmons)
- 73bb8d1 - Split out lambda (@ericclemmons)
- 2d5a047 - Simple node handler (@ericclemmons)
---

Automatically generated by `🤖 CHANGEBOT`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant