findaAll undefined

const product = require(’…/…/db’).product
const route = require(‘express’).Router();

route.get(’/’,(req,res)=>{
product.findAll()
.then((products)=>{
res.status(200).send(products)
})

.catch((err)=>{
res.status(500).send({
error: “colud not retrive products”
})
})

})

route.post(’/’,(req,res)=>{
if(isNaN(req.body.price)){
return res.status(403).send({
error:"price is not valid number "
})
}
product.create({
name:req.body.name,
manufacture:req.body.manufacture,
price:parseFloat(req.body.price)
})
.then((product)=>{
res.status(201).send(product)
})
.catch((err)=>{
res.status(501).send({
error:“error adding product”
})
})
})

exports=module.exports=route

this is my code and i am getting this error

TypeError: Cannot read property ‘findAll’ of undefined
at C:\Users\ARYAN AGRAWAL\Desktop\shoping cart\routes\api\products.js:7:9

Can you console.log(product) and show me what is the output

const sequilize =require(‘sequelize’)

const db=new sequilize(‘shopdb’,‘shoper’,‘shoppass’,{

host:'localhost',

dialect:‘mysql’,

poool: {

min:0,

max:3,

}

})

const user=db.define(‘users’,{

id:{

    type:sequilize.INTEGER,

    autoIncrement:true,

    primaryKey:true

},

name:{

    type:sequilize.STRING,

    allowNull:false

}

})

const product =db.define(‘products’,{

  • id:{*

  •    type:sequilize.INTEGER,*
    
  •    autoIncrement:true,*
    
  •    primaryKey:true*
    
  • },*

  • name:{*

  •    type:sequilize.STRING,*
    
  •    allowNull:false*
    
  • },*

  • manufacture:sequilize.STRING,*

  • price:{*

  •    type:sequilize.FLOAT,*
    
  •    allowNull:false,*
    
  •    defaultValue:0.0*
    
  • } *

})

db.sync()

.then(()=>{

console.log(“databse has cretaed”)

})

.catch((err)=>{

console.error(err)

})

exports = module.export = {

user,product

}

Can you share github link of this code? Are you able to connect to db?