tork-a / roswww

Tiny web server for ROS (forked from https://github.com/jihoonl/roswww)
Other
36 stars 25 forks source link

Proposal: Single page applications #44

Open jorgenfb opened 6 years ago

jorgenfb commented 6 years ago

Single page applications do client side routing, but the application only have a singe page doing all the work. I'm proposing to add a flag to make this possible by serving the default page index.html for all 404 Not Found requests. Flag: --single-page-app (debatable)

I would also propose another option to only serve the content from a single package at the root of this server. This is useful for serving control interface applications for a specific system. Flag: --single-pkg=mypackage (debatable)

My use case is that I have a single page application that I am using as the control interface for my robot application that I would like to bundle and serve with the rest of my control software. I do not need to serve files from more than this single package.

I'm opening this issue to discuss if these are wanted functionality and if so, the API. I'm willing to submit a PR if you are interested.

jorgenfb commented 5 years ago

I'm currently maintaining a fork for my own needs that allows me to serve a singe page application from a single package.

130s commented 5 years ago

I think PR is always welcomed. Fact that there's only one person who favors the feature doesn't always mean the usecase is limited to that person :)

jorgenfb commented 5 years ago

I do agree. I opened this issue to check the interest, in particular from the maintainer. There is no point in submitting a PR if the maintainer is non-responsive, the PR will never get merged. If I get time to clean up my fork I will consider publishing it for use by others.

kauffmanes commented 4 years ago

@jorgenfb I'd love to see this!