0

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

zurfyx
  • 31,043
  • 20
  • 111
  • 145
Fabian Tschullik
  • 95
  • 1
  • 2
  • 9
  • Hi @FabianTschullik if any of the answers has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. – zurfyx Feb 12 '17 at 17:21

1 Answers1

0

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.

Community
  • 1
  • 1
zurfyx
  • 31,043
  • 20
  • 111
  • 145