var express = require('express');
var router = express.Router();
var bcrypt = require("bcrypt");
const User = require('../models/user');
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
router.get("/createuser", async function(req, res, next) {
const password = await bcrypt.hash('first', 10);
const user = await User.create({username: 'first', password: password});
res.json({user: user});
});