This is a PoC for sharing common code without having to use hydrate
. It allows for shared code between routes, (and I think even with tree-shaking?). It's just how my brain organizes code like this, so I thought I'd give it a try.
I added Typescript, Prettier, and a few other things while I was at it. Feedback welcome!
This is based on @brianleroux's OAuth article and example: https://github.com/begin-examples/learn-node-oauth
- If a route imports a common file that has an external dependency, the
package.json
within that route needs to include it. I haven't figured out a way to make this smarter, (yet).
Deploy your own clone of this app to Begin!
- Start the local dev server:
npm start
- Lint your code:
npm run lint
- Run your tests:
npm t
- Quickstart - basics on working locally, project structure, deploying, and accessing your Begin app
- Creating new routes - basics on expanding the capabilities of your app
Head to docs.begin.com to learn more!