-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addresses #111 by adding a local API proxy #112
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together!
@@ -5,19 +5,26 @@ const eyeglass = require("eyeglass"); | |||
|
|||
const app = express() | |||
const port = 1337 | |||
const debug = true | |||
const proxy = debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if this wasn't on by default, otherwise how would we have found #111 -
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is only enabled when debug is enabled and when the window.location is not hackmud.com.
If we want debug and proxy to be configurable, it probably makes sense to extract them to a config file/envvars/cmdline flags before making them default false.
What's the most common way to provide config to NodeJS apps? I'll implement whichever is more familiar. (I change the default port too, so it'll be handy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a handful of options. Here are a few:
- modifying package.json (and reading config out of there)
- new .json file in the root
- new config.js file that is referenced in the file via package require (allows for programmatic stuff to happen more than pure key-values)
I think we should probably do 2. for now.
No description provided.