Answer the question
In order to leave comments, you need to log in
How to build angular with routes for different directories?
The project is made on Angular.js using routing without # . For the routing to work correctly, the header must contain , where dir is the root directory.
But on our server, versions are uploaded automatically and look like this: site.ru/vers_1.9. those. on site.ru list with links to versions, and in site.ru/vers_x.x. the same interface. Accordingly, /vers_x.x./ should be written in the base tag /vers_x.x./
Each time it is not an option to manually register. It is problematic to automatically write the same in index.html. The best option is the configuration file, where jenkins set the path when uploading to the server.
I tried to implement:
1. download config.json from the beginning
2. parse it
3. from the received data we substitute into the markup
4. and at the end of the body we substitute all the remaining scripts.
But there are a lot of errors in the console and the project does not start.
An example can be viewed here .
Answer the question
In order to leave comments, you need to log in
Write a simple gulp-task
https://www.npmjs.com/package/gulp-inject
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question