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

Pull the static file server into the CRA proxy as well #398

Merged
merged 6 commits into from
May 22, 2024

Conversation

JulianKniephoff
Copy link
Member

With this, the outer npm-project is finally obsolete. See the updated README for how to use it and the proxy server. I abstained from restructuring the project any further to keep the PR focused, but a PR that will do nothing but move things around is in the pipeline.

Note, this is based on #394.

@JulianKniephoff JulianKniephoff added type:dependencies Pull requests that update a dependency file type:code-enhancement Internal improvements to the codebase labels May 16, 2024
Copy link
Contributor

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

JulianKniephoff added a commit to JulianKniephoff/opencast-admin-interface that referenced this pull request May 16, 2024
With the refactoring of the development servers done in opencast#398
and indirectly opencast#394, there is an opportunity to boil down
the project structure a bit.

This PR does nothing but move files around and make the necessary
changes to keep everything working. (Fingers crossed.)
This was referenced May 16, 2024
@JulianKniephoff JulianKniephoff force-pushed the pull-in-static-server branch from 6591692 to 945e51c Compare May 21, 2024 10:27
JulianKniephoff added a commit to JulianKniephoff/opencast-admin-interface that referenced this pull request May 21, 2024
With the refactoring of the development servers done in opencast#398
and indirectly opencast#394, there is an opportunity to boil down
the project structure a bit.

This PR does nothing but move files around and make the necessary
changes to keep everything working. (Fingers crossed.)
package.json Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Removing this, we need to remove this from the CI as well:

- name: download tooling dependencies
run: npm ci

Copy link
Member Author

Choose a reason for hiding this comment

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

To be fair, this wasn't there when I first created this. ;D

res.status(201);
}

req.url = `/${req.method}/${req.originalUrl}`;
Copy link
Member

Choose a reason for hiding this comment

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

The req.originalUrl already starts with /, so we don't need one as separation:

Suggested change
req.url = `/${req.method}/${req.originalUrl}`;
req.url = `/${req.method}${req.originalUrl}`;

Copy link
Member Author

Choose a reason for hiding this comment

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

This was probably caused by trying and reverting lots of different things. Fixed now.

}
};

const testFiles = express.static(path.join(__dirname, "../../test"));
Copy link
Member

Choose a reason for hiding this comment

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

The path is missing the /app:

Suggested change
const testFiles = express.static(path.join(__dirname, "../../test"));
const testFiles = express.static(path.join(__dirname, "../../test/app"));

Without this change, running npm start will immediately end in an error.

Copy link
Member Author

Choose a reason for hiding this comment

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

And this was probably missed when separating this from #399.

@lkiesow lkiesow self-assigned this May 21, 2024
With this, the outer npm-project is finally obsolete.
See the updated `README` for how to use it and the proxy server.
I abstained from restructuring the project any further
to keep the PR focused, but a PR that will do nothing
but move things around is in the pipeline.

Note, this is based on opencast#394.
@JulianKniephoff JulianKniephoff force-pushed the pull-in-static-server branch from 945e51c to 74b8df4 Compare May 22, 2024 11:33
@JulianKniephoff JulianKniephoff requested a review from lkiesow May 22, 2024 11:35
@lkiesow lkiesow merged commit 04741aa into opencast:main May 22, 2024
2 checks passed
@JulianKniephoff JulianKniephoff deleted the pull-in-static-server branch May 23, 2024 07:46
JulianKniephoff added a commit to JulianKniephoff/opencast-admin-interface that referenced this pull request May 23, 2024
With the refactoring of the development servers done in opencast#398
and indirectly opencast#394, there is an opportunity to boil down
the project structure a bit.

This PR does nothing but move files around and make the necessary
changes to keep everything working. (Fingers crossed.)
JulianKniephoff added a commit to JulianKniephoff/opencast-admin-interface that referenced this pull request May 23, 2024
With the refactoring of the development servers done in opencast#398
and indirectly opencast#394, there is an opportunity to boil down
the project structure a bit.

This PR does nothing but move files around and make the necessary
changes to keep everything working. (Fingers crossed.)
JulianKniephoff added a commit to JulianKniephoff/opencast-admin-interface that referenced this pull request May 23, 2024
With the refactoring of the development servers done in opencast#398
and indirectly opencast#394, there is an opportunity to boil down
the project structure a bit.

This PR does nothing but move files around and make the necessary
changes to keep everything working. (Fingers crossed.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:code-enhancement Internal improvements to the codebase type:dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants