Express routing - all routes allowed not working
<p>I'm building a Vuejs app in a express server.
I want to display my app for all routes, then I will manage those routes in my Vue app router.</p>

<p>If I defined a unique route like <code>/home</code> my Vue app is well displayed, but when I define the router as <code>/*</code> to allowing all routes, the render doesn't work</p>

<pre><code>router.get('/*', function (req, res) { 
    return res.render("application")
});
</code></pre>

<blockquote>
  <p>app.js:1 Uncaught SyntaxError: Unexpected token &lt;</p>
</blockquote>

<p><strong>application.html</strong></p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;My title&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="app"&gt;&lt;/div&gt;
&lt;script src="public/app.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The error is because of the <code>app.js</code> read as the <code>application.html</code> file (weird). But if I define a unique route (ex : <code>/home</code>)  the content of the <code>app.js</code>is correct and my app works.</p>

<p>just in case : <strong>app.js</strong></p>

<pre><code>var express = require('express'), 
    app = express(),
    router = express.Router(),
    mustacheExpress = require('mustache-express') 

app.use(router)
app.engine('html', mustacheExpress());          
app.set('view engine', 'html');               
app.set('views', __dirname + '/views');
app.use('/public', express.static('public'));

router.get('/*', function (req, res) {  
     return res.render("application");
});

app.listen(9000)
module.exports = app; 
</code></pre>

<p><strong>UPDATE</strong>
As @rsp said, the problem comes from the included script (<code>app.js</code>) in my html file, because it's also match the the <code>/*</code> route</p>

<p>The new updated problem is now :  how to have an exception just for those 'public' file in routes? </p>