title: Angular only works if I specify app.get("*"[...]); in my server.js
body: <p>I just startet developing with server side JavaScript and this is my first project with it.</p>
  
  <p>It is a command and control server for my owncloud server running with angular, Expressjs and bootstrap. At the moment I got trouble adding the functionality for the stop server button.</p>
  
  <p>It should some code to log into the the server via <code>ssh</code> and do all the necessary stuff to shut it down gracefully.</p>
  
  <p>The problem is, that I really can't (and also don't want to) add this via a browser script since I want to use an ssh library. Running a server side script by pressing a button doesn't seem to be possible at all (please tell me how if it is anyway, that would be the solution to all of my problems :)).</p>
  
  <p>So I thought I could redirect the user to the <code>/on</code> page as he clicks the button and perform the actions in the app.get callback function. And here is the problem: In my <code>server.js</code> (the main node server) I have "two" endpoints defined at the moment</p>
  
  <pre><code>app.get("*", (req, res) =&gt;{
    res.sendFile(path.join(__dirname, "src/index.html"));
  });
  </code></pre>
  
  <p>and </p>
  
  <pre><code>app.get("/on", (req, res) =&gt;{
    console.log("redirecting...");
    //DO SOMETHING
    res.redirect("/");
  });
  </code></pre>
  
  <p>In the second one I would like to perform the ssh actions.
  But as I change the first code block to (notice the / instead of the *)</p>
  
  <pre><code>app.get("/", (req, res) =&gt;{
    res.sendFile(path.join(__dirname, "src/index.html"));
  });
  </code></pre>
  
  <p>The whole app doesn't seem to have angular any more. All angular components do show up but they are just empty and not filled with the content I defined in the app.component.html. Why is this occurring and how can I fix this? Thank you for any help ;)
  PS: you can find all the code at: <a href="https://github.com/Clemens-Dautermann/node-server" rel="nofollow noreferrer">GitHub</a></p>