StydeNet / enlighten

Enlighten your APIs with auto-generated documentation
MIT License
575 stars 32 forks source link

Inability to use exported documentation (redundant `/` symbol at the beginning of assets URLs ) #48

Closed havryliv closed 3 years ago

havryliv commented 3 years ago

Describe the bug Exported documentation (HTML/CSS/JS files) has a redundant / symbol at the beginning of assets URLs which leads to inability to use it.

To Reproduce Steps to reproduce the behavior:

  1. Execute php artisan enlighten:export command, set any directory and URL.
  2. Open folder where you exported your documentation
  3. Open index.html in the browser ( or host it on the server and open it via URL )
  4. See reproduced issue ( no styles, no scripts loaded and errors in the console - see screenshots section )

Expected behavior Ability to set any base URL for the exported docs, it might be localhost, https://whatever.com or ./. Hosted on the server or locally files should work like on Laravel.

Screenshots

Screen Shot 2021-01-12 at 14 36 03 Screen Shot 2021-01-12 at 14 36 24
sileence commented 3 years ago

Hi @havryliv, what URLs are you using when running the export command? Could you please paste a screenshot of that.

Also what are you using to run the project? It seems you're not using a virtual host and that could be the cause (I haven't tested the export without a virtual host)

havryliv commented 3 years ago

Hi @sileence I do not use any virtual host since it's an export for a static usage. It does not rely on the APP_URL and it's good, having a possibility to set the base URL is needed.

Screenshots

Screen Shot 2021-01-12 at 14 48 05 Screen Shot 2021-01-12 at 14 50 42
sileence commented 3 years ago

@havryliv I just pushed a fix for this problem in the dev branch, it should be deployed and tagged soon.