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

[server] Allow setting different basepath and static web #1104 #1105

Merged
merged 12 commits into from
Jun 7, 2024

Conversation

pinghe
Copy link
Contributor

@pinghe pinghe commented May 21, 2024

Allow setting different basepath. And support for static web services.

@michaelvlach
Copy link
Collaborator

Hi, thanks for the PR. What is the use case here? I think I can see the base path being potentially useful but I do not understand why do you want to move the open API schéma to hardcoded "watom" path. Can you please elaborate?

@pinghe
Copy link
Contributor Author

pinghe commented May 22, 2024

Hi, thanks for the PR. What is the use case here?

browser ----> reverse proxy (http://10.10.10.10/public/api/vi/)----> agdb_server http://192.168.10.10/public/api/v1
http://10.10.10.10/public/ web page

I think I can see the base path being potentially useful but I do not understand why do you want to move the open API schéma to hardcoded "watom" path. Can you please elaborate?

This is an error. :(

agdb_server/src/app.rs Outdated Show resolved Hide resolved
agdb_server/src/config.rs Outdated Show resolved Hide resolved
@michaelvlach
Copy link
Collaborator

You should add at least one test, probably in misc_routes.rs to verify the base path indeed works. You can get inspiration how to write it from the other tests, particularly those that set something special in the config like cluster_test.rs. It is basically just a hashmap you pass to the TestServerImpl:

let mut config =HashMap::<&str, serde_yaml::Value>::new();
config.insert("basePath", "public".into());
let server = TestServerImpl::with_config(config).await?;

@michaelvlach michaelvlach enabled auto-merge (squash) June 7, 2024 15:53
agnesoft
agnesoft previously approved these changes Jun 7, 2024
@michaelvlach michaelvlach merged commit 0ff3647 into agnesoft:main Jun 7, 2024
41 checks passed
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.

3 participants