Passing in MYSQL_HOST during MySQL connection configuration
This commit is contained in:
parent
02327fc734
commit
c47d7aa0f5
1 changed files with 2 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ import mysql, { Connection, ConnectionConfig, FieldInfo } from 'mysql'
|
||||||
import { TABLE_reservations } from './sql'
|
import { TABLE_reservations } from './sql'
|
||||||
|
|
||||||
const createConnectionConfig = async (): Promise<ConnectionConfig> => {
|
const createConnectionConfig = async (): Promise<ConnectionConfig> => {
|
||||||
|
const host = process.env.MYSQL_HOST
|
||||||
const user = process.env.MYSQL_USER
|
const user = process.env.MYSQL_USER
|
||||||
const password = process.env.MYSQL_PASSWORD
|
const password = process.env.MYSQL_PASSWORD
|
||||||
const database = process.env.MYSQL_DATABASE
|
const database = process.env.MYSQL_DATABASE
|
||||||
|
|
@ -11,6 +12,7 @@ const createConnectionConfig = async (): Promise<ConnectionConfig> => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
host,
|
||||||
user,
|
user,
|
||||||
password,
|
password,
|
||||||
database,
|
database,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue