feat: add baseURL dev and sequelize error
This commit is contained in:
		| @@ -2,7 +2,12 @@ import { Query } from '@kevisual/query'; | ||||
| import { getConfig } from './get-config.ts'; | ||||
| const config = getConfig(); | ||||
| export const baseURL = config?.baseURL || 'https://envision.xiongxiao.me'; | ||||
|  | ||||
| export const getBaseURL = () => { | ||||
|   if (config?.dev) { | ||||
|     return 'http://localhost:4002'; | ||||
|   } | ||||
|   return baseURL; | ||||
| }; | ||||
| export const query = new Query({ | ||||
|   url: `${baseURL}/api/router`, | ||||
| }); | ||||
|   | ||||
| @@ -8,6 +8,9 @@ export const sequelize = new Sequelize({ | ||||
|   // logging: false, | ||||
| }); | ||||
|  | ||||
| sequelize.authenticate({ logging: false }).then(() => { | ||||
|   console.log('Connection sqlite has been established successfully.'); | ||||
| }); | ||||
| sequelize | ||||
|   .authenticate({ logging: false }) | ||||
|   .then(() => {}) | ||||
|   .catch((err) => { | ||||
|     console.error('Unable to connect to the database:', err); | ||||
|   }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user