12345678910111213141516171819202122 |
- var db = require('../db.js');
- var users = require('./users.js');
- db.init();
- let u = {
- username: "test",
- password: "test",
- email: "[email protected]"
- }
- users.register(u).then(console.log).
- catch((e) => {
- if(e.name === "UsernameExists"){
- console.log("Username exists register is bypassed!");
- }
- });
- users.login(u).then(console.log).
- catch((e) => {
- console.log(e);
- });
|