-
Notifications
You must be signed in to change notification settings - Fork 33
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
adds h5p server to materia stack, along with oauth changes for uploading media #1362
base: master
Are you sure you want to change the base?
Conversation
…l necessary libraries during initial setup
…ignore in h5p/core and h5p/editor
h5p-server/renderers/player.js
Outdated
switch (context) { | ||
case "prod": | ||
case "dev": | ||
materiaPath = "https://localhost:8008"; |
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.
This url definitely shouldn't be hard-coded, but rather sourced from an env or other configuration. Doing so usually means pushing an inline variable definition in the fuel controller method that renders this content, via:
Js::push_inline('var BASE_URL = "'.Uri::base().'";');
Here's an example: https://github.com/ucfopen/Materia/blob/master/fuel/app/classes/controller/widgets.php#L519
h5p-server/express.js
Outdated
// TODO replace whitelist with hosts from context env var | ||
app.use( | ||
cors({ | ||
origin: [ |
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.
Same as previous comment - these URLs will have to come from a config somewhere.
// return a new h5p widget | ||
// used for materia to check for specific library | ||
// should be deprecated as there is no need to save this information on the server | ||
app.post("/new/:type", (req, res) => { |
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.
Is this section actually used? My understanding is we're not actually saving H5P content on the server - which I'm pretty sure was the original intent of the /new/
post request. I'm not sure if Materia actually performs this request as the comment suggests.
Added H5P URL and exposed it to player js
…r/ directory, adds some forgotten .env variables for h5p to communicate with materia, and makes some updates to allow h5p to run as a standalone server
also closes #1356