Full Stack Web App using Vue.js & Express.js: Part 2 - Sequelize
Why Stack Overflow recommends it
Stack Overflow users link it as the tutorial they were following when they hit errors with Node module paths, Sequelize models, MySQL queries and Vuetify styling.
Recommended by 0 people across 0 different months, 2018 to 2020.
What it is
Part 2 of a freeCodeCamp series by Cody Seibert on building a full stack web app with Vue.js and Express.js. This installment sets up Sequelize as the ORM on the Express backend, defining a User model and wiring up the database connection, following the tab-tracker GitHub repo.
What people said
Cites Brayn Brigoli · 2018-04 · Stack Overflow · on “What does DataType in sequelize do? Why pass it in the argument and ran without defining it?”
I saw this tutorial but there are few things I don't understand. The link to the tutorial is [this video] This creates the model module.exports = (sequelize, DataTypes) => sequelize.define('User', { email:{ type: DataTypes.STRING, unique: true }, password: DataTypes.STRING }) //this imports the model const fs = require('fs') const path = require('path') const Sequelize = require('sequelize') const config = require('../config/config') const db = {} var a = '' const sequelize = new Sequelize( config.db.database, config.db.user, config.db.password, config.db.options ) fs .readdirSync(__dirname) .filter((file) => file !== 'index.js' ).forEach((file) => { const model = sequelize.import(path.join(__dir
Cites grannymits3 · 2019-07 · Stack Overflow · on “Cannot read property 'query' of undefined, node/mysql”
I am getting this error "UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'query' of undefined at register". Other posts I looked at seemed to be issues with the DB not connecting properly, but I am getting the console.log message that the db is connected. const { db } = require("../config/db.js"); module.exports = { async register(req, res) { db.query( "INSERT INTO users(username, email, password) VALUES(?, ?, ?)", [req.body.username, req.body.email, req.body.password], (err, results, fields) => { if (!err) { res.send("it worked!"); } else { console.log("error"); } } ); } }; const mysql = require("mysql"); const db = mysql.createConnection({ host: "localhost", user: "root",
Cites dustycaviar · 2020-03 · Stack Overflow · on “Vuetify css not applying”
I am working through this [this video] tutorial. I am about 40 minutes in where he is adding Vuetify and I have followed along and my code is the same as his as far as I can tell, however it seems Vuetify won't load on my end. In the following picture, the left is what it looks like on my screen vs on the right the tutorial/ what it should look like. [LINK] Here is the relevant .vue page: <template> <v-layout column> <v-flex xs6 offset-xs3> <div class="white elevation-2"> <v-toolbar class="cyan" flat dense dark> <v-toolbar-title>Register</v-toolbar-title> </v-toolbar> <div class="pl-4 pr-4 pt-2 pb-2"> <input type="email" name="email" v-model="email" placeholder="email" /> <br> <input type="passwo
Cites Shadow · 2020-08 · Stack Overflow · on “Error: internal/modules/cjs/loader.js:968 throw err; node module?”
I was following this [this video] YouTube tutorials series but suddenly while running server i got this problem I tried re-uninstalling node to latest stable version. internal/modules/cjs/loader.js:968 throw err; ^ Error: Cannot find module 'D:\DATA\Learning\Creations\WEB\website\tabs tracker\Vue-and-Express.JS\server\scr\app.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15) at Function.Module._load (internal/modules/cjs/loader.js:841:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } code of app.js const express = require('express') const bod