first commit
This commit is contained in:
18
app/config/database.js
Normal file
18
app/config/database.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const { Sequelize } = require('sequelize');
|
||||
require('dotenv').config();
|
||||
|
||||
const sequelize = new Sequelize(
|
||||
process.env.DB_NAME,
|
||||
process.env.DB_USER,
|
||||
process.env.DB_PASS,
|
||||
{
|
||||
host: process.env.DB_HOST,
|
||||
dialect: process.env.DB_DIALECT,
|
||||
logging: process.env.NODE_ENV === 'development' ? console.log : false,
|
||||
define: {
|
||||
timestamps: true
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = sequelize;
|
||||
22
app/config/midtrans.js
Normal file
22
app/config/midtrans.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const midtransClient = require('midtrans-client');
|
||||
require('dotenv').config();
|
||||
|
||||
class MidtransConfig {
|
||||
static getSnapClient() {
|
||||
return new midtransClient.Snap({
|
||||
isProduction: process.env.MIDTRANS_IS_PRODUCTION === 'true',
|
||||
serverKey: process.env.MIDTRANS_SERVER_KEY,
|
||||
clientKey: process.env.MIDTRANS_CLIENT_KEY
|
||||
});
|
||||
}
|
||||
|
||||
static getCoreApiClient() {
|
||||
return new midtransClient.CoreApi({
|
||||
isProduction: process.env.MIDTRANS_IS_PRODUCTION === 'true',
|
||||
serverKey: process.env.MIDTRANS_SERVER_KEY,
|
||||
clientKey: process.env.MIDTRANS_CLIENT_KEY
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MidtransConfig;
|
||||
Reference in New Issue
Block a user