Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot load file from assets like /assets/images/* /assets/js/* /assets/* #69

Closed
shuihuasheng opened this issue Feb 11, 2020 · 3 comments
Labels
question Further information is requested

Comments

@shuihuasheng
Copy link

how to load file from assets like /assets/images/* /assets/js/* /assets/*

@why520crazy
Copy link
Member

I don't fully understand, please describe it clearly.

localhost:3000/assets/* is redirect portal app.

if you access sub apps assets, please use localhost:3000/static/app1/assets/*, the /static/app1 path is set in proxy.conf.js

@shuihuasheng
Copy link
Author

shuihuasheng commented Feb 11, 2020

sub app should be possible to run the program either standalone, and as part of a micro-service, as shown in the examples above.

sub app : <img [src..]="./assets/images/xxx.png" class="xxx-logo"> load-success
when i use "http://localhost:3000/static/app3/app3/login-system" load sub app
the <img [src..]="./assets/images/xxx.png" class="xxx-logo"> redirectly to "http://localhost:3000/assets/images/soe.png" it is 404
sub app config : "
ng serve -o --port=4400 --host=0.0.0.0
--base-href=/static/app3/
--deploy-url=/static/app3/",

main app config:
PROXY_CONFIG['/static/app3'] = {
target: 'http://localhost:4400',
secure: false,
changeOrigin: true
};

        {
            name: 'app3',
            hostParent: '#app-host-container',
            selector: 'app3-root-container',
            // hostClass: appHostClass,
            routerPathPrefix: '/app3',
            scripts: [
                '/static/app3/main.js',
            ],

        }

@shuihuasheng
Copy link
Author

my solve is <img [src..]="/static/app3/assets/images/xxx.png" class="xxx-logo">

it is not a Elegant solution;

@why520crazy why520crazy added the question Further information is requested label Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants