const db = require('../utils/db.js')

// import controller function.
const systeminfo = async(req, res, next)=>{
    try {
        const sql = `SELECT * FROM site WHERE id = ?`;
        db.query(sql, ['1'], (err, result)=>{
            if(err) return res.status(400).json({message:err})
            res.status(200).json({message:'found', data:result[0]})
        })
    } catch (error) {
        next(error)
    }
}

module.exports = {systeminfo}