Adding subfolder support - #186
Conversation
| <div class="github"><iframe id="ghbtn" frameborder="0" scrolling="0" width="145px" height="30px"></iframe></div> | ||
| </div> | ||
|
|
||
| <!-- build:js /js/all.js --> |
There was a problem hiding this comment.
You need to remove the slash on /js/all.js as well. In case someone runs the optimized version of the server, this is the path of the compiled JS file.
|
Thanks a lot for this cool work! I marked a few details, please tell me if its unclear. Until now I was using |
|
Hi, |
| <meta property="og:image" content="img/logo-large.png" /> | ||
| <meta name="description" content="Free online web performance tool. Audit your webpage for performance and front-end quality issues. And it's open-source!" /> | ||
|
|
||
| <!-- build:css /css/styles.css--> |
There was a problem hiding this comment.
Same with <!-- build:css /css/styles.css-->, sorry I didn't catch it the first time :/
|
Thanks, just one little more change and we're good to go! |
|
👍 |
|
Great job! |
|
Hi,
|
|
Thank you for reporting this. |
Hi @gmetais,
I did some changes to the application to add a support of subfolder use, for example behind a reverse proxy. The application was not usable in /subfolder because of the absolute paths used for assets and by AngularJS for views.
I added a "baseUrl" parameter in the settings file, by default set to "/". This parameter is injected in the tag in the main HTML document. To be able to inject a parameter in the HTML, I added a HTML template engine named EJS. The static method from Express is still used for assets. Then I changed all the absolute paths for relative ones (assets, API, results, etc).
The scenario is to let "/" for a use on a domain without subfolder, and to configure the full URL for a subfolder (with a trailing slash). Example : "https://domain.com/yellowlabtools".
It's my first time working on NodeJS, Express, EJS and AngularJS, so feel free to let me comments about the development :-)
I've tested on a reverse proxy on nginx and Apache.