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

Add publicEndpoint to override resolved endpoint #37

Merged
merged 11 commits into from
Oct 5, 2021

Conversation

ktonon
Copy link
Contributor

@ktonon ktonon commented Oct 5, 2021

Trying to get everything using https. This PR makes it possible to serve the app resolver using ngrok

@@ -78,6 +80,7 @@ var target = appResolver.getUrl();
- `dist` - The directory containing the app files to serve. By default, the `dist` directory is used.
- `port` - The port to listen on. By default, port `3000` is used, which is the port that the LMS expects it on.
- `hostname` - The hostname (or IP) to listen on. By default, the hostname of the operating system is used. You should not need to change this.
- `publicEndpoint` - If provided overrides the protocol (http) hostname and port for endpoint resolution
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option would be to make the new parameter protocol, so then you could use the existing port and hostname options and just set protocol = https. 🤷

Copy link
Contributor Author

@ktonon ktonon Oct 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that first, but I ran into trouble when trying to run the server. I also had to change the value of the port, which messed up this line:

app.listen(self._opts.port, function() {

I only want to override the value which gets written into the appconfig.json file, i.e. for the loader endpoint. Having a single value to override makes it easier to customize the endpoint from the command line.

For example, in the smart-curriculum project, I'm doing this:

npm run build:config -- --publicEndpoint=https://arkt.ngrok.io

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, makes sense!

@dlockhart dlockhart merged commit 345d0bf into main Oct 5, 2021
@dlockhart dlockhart deleted the ktonon/public-endpoint branch October 5, 2021 16:58
@ghost
Copy link

ghost commented Oct 5, 2021

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants