Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

empmud
Copy link

@empmud empmud commented Jan 21, 2021

No description provided.

Copy link
Member

@seanmakesgames seanmakesgames left a 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
Copy link
Member

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 -

Copy link
Author

@empmud empmud Jan 26, 2021

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)

Copy link
Member

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:

  1. modifying package.json (and reading config out of there)
  2. new .json file in the root
  3. 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.

index.js Show resolved Hide resolved
js/chat.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants