retype icon indicating copy to clipboard operation
retype copied to clipboard

Project config URL parameter does not support subfolders

Open JacobCrofts opened this issue 3 years ago • 3 comments

I am trying to host my docs under somedomain.com/docs, where /docs is the subfolder. To do so, I set the url parameter in retype.yml to somedomain.com/docs. However, when I go to visit the site I hosted (including the subfolder), I get a 404. I can see in the server logs that the correct pod is handling the request, which rules out an NginX issue:

10.244.0.80 - - [10/Nov/2022:21:51:35 +0000] "GET /docs HTTP/1.1" 404 196

Both apps work as expected locally with retype watch, and the "non-working" one is correctly hosted under localhost:5000/docs. When I run it with Docker instead, the "non-working" one is functional but is hosted under localhost:8080. The subfolder disappears, which may be expected and isn't really a problem for me in local development.

In production, though, it seems to me that Retype's routing is incorrect. Retype is probably trying to serve a Markdown file found within the literal directory docs. It should ignore the /docs prefix during routing.

Other notes:

  • hosting with Docker + Kubernetes + NginX ingress
  • working example that I am hosting temporarily
  • non-working example with subfolder that I am hosting temporarily
  • PR demonstrating what I changed between working and non-working examples
  • 99% sure this doesn't matter: I installed Retype with yarn locally but my Dockerfile installs it with dotnet

JacobCrofts avatar Nov 10 '22 22:11 JacobCrofts

FYI, I am no longer hosting the example applications I described above. The issue still stands and I have not found a workaround.

JacobCrofts avatar Mar 18 '23 00:03 JacobCrofts

We would need to setup a similar environment in order to test this scenario, but I can't say I've run into this issue previously.

I see in your retype.yml file that you do not include the /docs folder in the url.

url: thing-docs-working.managemc.com

Does adding the /docs folder help get this scenario working?

url: thing-docs-working.managemc.com/docs

geoffreymcgill avatar Mar 25 '23 09:03 geoffreymcgill

@geoffreymcgill, I did change retype.yml in the example branch where I showed what changed between the working and non-working deployed examples.

I was able to reproduce the bug locally, however, which simplifies matters a lot. Please check the main branch of the example repo and run it as described in the README when you have time. Thanks!

JacobCrofts avatar Mar 27 '23 22:03 JacobCrofts