title: How to create a Front end (VueJS) for an API created by using NodeJS + Express + MongoDB
body: <p>I've created a REST API by using Express. All the info is stored in MongoDB and all the endpoints of an API return JSON.</p>
  
  <p><strong>index.js (main)</strong></p>
  
  <pre><code>const express =     require('express');
  const bodyParser =  require('body-parser');
  const mongoose =    require('mongoose');
  const app =         express();
  
  /* Connect to a DB */
  mongoose.connect('mongodb://localhost/cars');
  mongoose.Promise = global.Promise;
  
  app.use(bodyParser.json());
  /* Initialize routes */
  app.use('/api', require('./routes/api'));
  
  /* Listening on port 3000 */
  app.listen(process.env.port || 3000, function() {
      console.log('I\'m ready for requests...');
  });
  </code></pre>
  
  <p><strong>/routes/api.js</strong></p>
  
  <pre><code>const express = require('express');
  const router =  express.Router();
  const Car =     require('../models/car');
  
  router.get('/cars', function(req, res) {
      res.send({
          type: 'GET'
      });
  });
  
  router.post('/cars', function(req, res) {
      Car.create(req.body).then(function(car) {
          res.send(car);
      });    
  });
  
  module.exports = router;
  </code></pre>
  
  <p>How can implement Vue.js into my API?</p>