/*
----------------------------------------------------
setup.js // SOA - 2016 // Simon Carlier
-----------------------------------------------------
used to insert users in the DB

*/
var express = require('express'),
  router = express.Router(),
  utils = require('../utils/utils'),
  mongoose = require('mongoose'),
  User = mongoose.model('User');
  base64url = require('base64url')


module.exports = function (app) {
  app.use('/setup/', router);
};


router.post('/', function(req,res,next){
	 var user = new User();
   user.username = "simka";
   user.password = "lolilol";

   user.save(function(err,createdUser){
      if(err){
        res.jsend.error("problem with the DB");
      }

      res.jsend.success(user);
   });

});
