-
Notifications
You must be signed in to change notification settings - Fork 23
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
Conversation
This pull request has conflicts ☹ |
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.)
6591692
to
945e51c
Compare
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
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.
Removing this, we need to remove this from the CI as well:
opencast-admin-interface/.github/workflows/test.yml
Lines 20 to 22 in 34dd129
- name: download tooling dependencies | |
run: npm ci |
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.
To be fair, this wasn't there when I first created this. ;D
app/src/setupProxy.js
Outdated
res.status(201); | ||
} | ||
|
||
req.url = `/${req.method}/${req.originalUrl}`; |
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.
The req.originalUrl
already starts with /
, so we don't need one as separation:
req.url = `/${req.method}/${req.originalUrl}`; | |
req.url = `/${req.method}${req.originalUrl}`; |
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 was probably caused by trying and reverting lots of different things. Fixed now.
app/src/setupProxy.js
Outdated
} | ||
}; | ||
|
||
const testFiles = express.static(path.join(__dirname, "../../test")); |
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.
The path is missing the /app
:
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.
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.
And this was probably missed when separating this from #399.
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.
945e51c
to
74b8df4
Compare
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.)
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.)
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.)
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.