简体   繁体   中英

Different index.html for angular app

I would like to use different index.html for my client.

I would like to have a /backend with a index.html and different views (working)

  • I would like to have a / where I want to implement some forms for the user (frontend) and use another index.html

I tried a lot of different things but I dont get it working.

I idea was to use something like this on my server side:

app.use(express.static(__dirname+'/client'));
app.use(express.static(__dirname+'/backend'));

but thats not working

Code is here: https://github.com/eftz/groundlevel

What you are trying to do is to simply render content to a template file:

app.get('/client', (req, res) => {
    res.render('client/index.html', params);
});

https://stackoverflow.com/a/12008228/2013580

If Angular is completely independent from Node, you can even use res.sendfile('client/index.html'); for that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM