-
Notifications
You must be signed in to change notification settings - Fork 22
feat: Implement --use-index & SPA flags #374
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
Conversation
@Antosser can we have 2 PRs for this? And tests as well please? Its easier to review and to ensure everything is working as expected. |
To split this up into 2 PRs, the second will need to come after the first one. They cannot coexist, because of potential merge conflicts. It would be faster to leave this PR as is. I can write test though. |
Why do the integration tests not get ran? Edit: And why do 7 of them fail |
An integration test is the right type of test to test the |
I still need an answer |
Hey @Antosser! I recommend reading the workflow files to understand how every test is executed. With regards to the organization of tests, I suggest leaving them as they are and discuss about them separately. Lately, for E2E testing I would use something like Bats. I could set in up for you and leave a couple examples for you to follow and apply on this PR. |
Do you mean the GitHub workflow files or the scripts?
Bats, as in .bat files? Couldn't finds anything else with this name |
<!-- Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. --> Provide tests workflow for CI --- ### Dependants - [ ] http-server-rs#402 - [ ] http-server-rs#374
@EstebanBorai I want to say that the reason people use this app is that it is the rust alternative to NPM's http-server. People expect, that it is blazingly fast, very reliable, easy to use, and feature-rich. It has to represent the Rust community very well. That's why I want to make this app as friendly and easy to use as possible. The purpose of NPM's http-server is to quickly set up an HTTP server to host HTML files, and that's the default. In my opinion, we should make that the default too and replace the I really want to add new features, but have no interest in writing non-rust bats tests. Can you please write them, so I can move on to other features without worrying about merge conflicts? Also, please consider using Thanks for the overall help! |
<!-- Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->
I love git |
LOL |
@Antosser can we have workflow changes in a separato PR please? |
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.
Lets move changes not related to SPA/index to a separate PR please!
.github/workflows/build.yml
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.
Move to a scoped PR please!
.github/workflows/clippy.yml
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.
Move to a scoped PR please!
.github/workflows/fmt.yml
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.
Move to a scoped PR please!
.github/workflows/test.yml
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.
Move to a scoped PR please!
LICENSE-MIT
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.
Can we have a specific PR for these updates? Im trying to narrow down this PR scope.
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.
I don't remember ever changing the license.
README.md
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.
I think its okay to add these changes as part of the LICENSE PR!
Cargo.toml
Outdated
@@ -58,6 +58,7 @@ tokio = { version = "1.29.1", features = [ | |||
tokio-rustls = "0.23.4" | |||
toml = "0.7.6" | |||
humansize = "2.1.3" | |||
colored = "2.0.4" |
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.
Can we add colors in another PR? So we revisit all places and keep UI consistent?
I never changed any of the workflow files, but it still looks like I changed them in this PR |
I think it has a couple issues while rebasing! |
Perhaphs you can delete those workflow files from your PR? |
If I delete them, and you merge the PR, they will also disappear in the main branch. |
@EstebanBorai Can I make the |
I would stick to current approach for now. I dont want to introduce unexpected changes for I have plans to move into Axum for a |
SGTM |
aight |
Implemented the --use-index flag. If the path matches a directory and an index.html is found inside, the index.html gets sent instead of the explorer of the directory.
Implemented the --spa flag. If a file/directory is not found, the index.html in the root gets sent. The existence of index.html in the root is also checked at startup. An error is thrown otherwise:
The docs were updated to match the new changes