title: nodejs how to serve node_modules directory to front end for access?
body: <p>Without using any packaging software such as Browserify or Webpack, I have a simple server that in nodejs. </p>
  
  <pre><code>var express = require('express');
  var bodyParser = require('body-parser');
  var request = require('request');
  var app = express();
  app.use(bodyParser());
  app.use(express.static('public'));
  app.use(express.static('node_modules'));
  
  
  app.post('/api/searchjob', function (req, res) {
    res.json({data: "hello"});
  });
  
  app.get('/', function(req,res) {
    res.sendfile('public/index.html');
  });
  
  app.get('/*', function(req, res){
    res.redirect('/');
  })
  
  app.listen(process.env.PORT || 3000, function () {
    console.log('Example app listening on port 3000!')
  });
  </code></pre>
  
  <p>I want the front end to also have access to some node_modules packages, what can i do? my index.html file is in "public" directory, the folder structure look like this: </p>
  
  <pre><code>├── README.md
  ├── index.js
  ├── node_modules
  ├── package.json
  ├── public
  └── yarn.lock
  </code></pre>
  
  <p>I tried simply put the script tag in index.html, but doesn't work
  <code>&lt;script src="../node_modules/vue2-google-maps/dist/vue-google-maps.js"&gt;&lt;/script</code>></p>