-> project_name
|-> component // Berisi React Component
|-> database // Berisi file yang berhubungan langsung dengan database
|-> migrations // Database Migrations
|-> seeds // Database Seeder
|-> db.js // File Konfigurasi Database
|-> layouts // Berisi Layouts Page
|-> middleware // Jembatan penghubung
|-> pages // Halaman yang ditampilkan ke user. Routing berdasarkan struktur folder
|-> public // File yang berada disini akan ditampilkan secara public
|-> styles // Berisi style halaman
Last active
November 3, 2021 04:17
-
-
Save imlana21/383bd9c21cf479e36da35dcea5eb50d2 to your computer and use it in GitHub Desktop.
Next Fullstack Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_CLIENT=mysql | |
DB_PORT=3306 | |
DB_HOST=127.0.0.1 | |
DB_NAME=nextfullstack | |
DB_USER= | |
DB_PASS= | |
BASE_URL=http://localhost:3000/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const db = require('knex')({ | |
client: process.env.DB_CLIENT, | |
connection: { | |
host: process.env.DB_HOST, | |
port: process.env.DB_PORT, | |
user: process.env.DB_USER, | |
password: process.env.DB_PASS, | |
database: process.env.DB_NAME, | |
}, | |
}); | |
export default db; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dotenv = require('dotenv'); | |
dotenv.config({ path: '.env.local'}); | |
module.exports = { | |
development: { | |
client: process.env.DB_CLIENT, | |
connection: { | |
host: process.env.DB_HOST, | |
port: process.env.DB_PORT, | |
user: process.env.DB_USER, | |
password: process.env.DB_PASS, | |
database: process.env.DB_NAME, | |
}, | |
migrations: { | |
directory: './database/migrations' | |
}, | |
seeds: { | |
directory: './database/seeds' | |
} | |
}, | |
staging: { | |
client: process.env.DB_CLIENT, | |
connection: { | |
host: process.env.DB_HOST, | |
port: process.env.DB_PORT, | |
user: process.env.DB_USER, | |
password: process.env.DB_PASS, | |
database: process.env.DB_NAME, | |
}, | |
pool: { | |
min: 2, | |
max: 10, | |
}, | |
migrations: { | |
directory: './database/migrations' | |
}, | |
seeds: { | |
directory: './database/seeds' | |
} | |
}, | |
production: { | |
client: process.env.DB_CLIENT, | |
connection: { | |
host: process.env.DB_HOST, | |
port: process.env.DB_PORT, | |
user: process.env.DB_USER, | |
password: process.env.DB_PASS, | |
database: process.env.DB_NAME, | |
}, | |
pool: { | |
min: 2, | |
max: 10, | |
}, | |
migrations: { | |
directory: './database/migrations' | |
}, | |
seeds: { | |
directory: './database/seeds' | |
} | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment