Adds initial backend API endpoints for fetching users and attendances, including basic filtering. Sets up the frontend routing with a layout component and includes placeholder pages for dashboard, users, and login. Refactors the README for local development setup.
29 lines
796 B
JavaScript
29 lines
796 B
JavaScript
|
|
const mysql = require('mysql2/promise');
|
|
|
|
// Configuração da conexão com o banco de dados
|
|
// Em produção, estes valores devem vir de variáveis de ambiente (.env)
|
|
const pool = mysql.createPool({
|
|
host: '162.240.103.190',
|
|
user: 'agenciac_comia',
|
|
password: 'Blyzer@2025#',
|
|
database: 'agenciac_comia',
|
|
waitForConnections: true,
|
|
connectionLimit: 10,
|
|
queueLimit: 0,
|
|
// Opções de SSL podem ser necessárias dependendo do servidor,
|
|
// mas vamos tentar sem SSL inicialmente dado o host.
|
|
});
|
|
|
|
// Teste de conexão simples ao iniciar
|
|
pool.getConnection()
|
|
.then(connection => {
|
|
console.log('✅ Conectado ao MySQL com sucesso!');
|
|
connection.release();
|
|
})
|
|
.catch(err => {
|
|
console.error('❌ Erro ao conectar ao MySQL:', err.message);
|
|
});
|
|
|
|
module.exports = pool;
|