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

adds h5p server to materia stack, along with oauth changes for uploading media #1362

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

ljoks
Copy link
Contributor

@ljoks ljoks commented Feb 21, 2022

also closes #1356

switch (context) {
case "prod":
case "dev":
materiaPath = "https://localhost:8008";
Copy link
Member

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

// TODO replace whitelist with hosts from context env var
app.use(
cors({
origin: [
Copy link
Member

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) => {
Copy link
Member

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.

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.

None yet

2 participants