I make a record in the database and do not understand where the name of the table comes from. I searched the project and did not find anything for users . Where does the name of the users table come from?
In the console, it displays the query Executing (default): INSERT INTO users(id,username,password,createdAt,updatedAt) VALUES (DEFAULT,'user3','$2b$10$ToRfI/yEM.awNG1pSr07veXviYZDb1qvFN2VoRwNEJOoEpSCyaQz.','2019-01-25 11:17:16','2019-01-25 11:17:16');
Controller himself:
'use strict'; let jwt = require('jsonwebtoken'); let config = require('../config'); let db = require('../services/database'); let User = require('../models/user'); // The authentication controller. let AuthController = {}; // Register a user. AuthController.signUp = function (req, res) { if (!req.body.username || !req.body.password) { res.json({ message: 'Please provide a username and a password.' }); } else { db.sync().then( async () => { let newUser = { username: req.body.username, password: req.body.password }; await User.create(newUser); res.status(201).json({ message: 'Account created!' }); }).catch((error) => { res.status(403).json({ message: 'Username already exists!' }); }); } } module.exports = AuthController;
sto the model name. - Yegor Banin