File size: 378 Bytes
181e22f
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import User from '../models/User';

export async function hello(req, res, next) {
  const user = await User.query().first();
  if (user) {
    res.send('There is a user, account: ' + user.account);
  } else {
    const newUser = await User.query().insert({
      account: 'account1',
      password: 'pass1',
    });
    res.send('Inserted new user: ' + newUser.account);
  }
}