Skip to content

Commit

Permalink
Set up .env.default #21
Browse files Browse the repository at this point in the history
  • Loading branch information
syedfarhankabir committed Sep 28, 2022
1 parent 578f989 commit a85fb59
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .env.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PORT=8902
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_PASSWORD=your_password
MYSQL_USER=tt
MYSQL_DATABASE=tt
PUBLIC_URI="http://localhost:8902/"

AUTH_API_URI=http://localhost:8531
OAUTH2_CLIENT_ID=
OAUTH2_CLIENT_SECRET=
APP_URI=http://localhost:8902
46 changes: 46 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
"@curveball/problem": "^0.3.0",
"@curveball/router": "^0.4.1",
"@curveball/validator": "^0.9.0",
"dotenv": "^16.0.2",
"dotenv-defaults": "^5.0.2",
"knex": "^1.0.3",
"luxon": "^2.2.0",
"mysql2": "^2.3.3"
Expand Down
4 changes: 4 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
require('dotenv').config();
require('dotenv-defaults').config();

import accessLog from '@curveball/accesslog';
import bodyParser from '@curveball/bodyparser';
import browser from '@curveball/browser';
Expand Down
10 changes: 5 additions & 5 deletions src/knexfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module.exports = {
development: {
client: 'mysql2',
connection: {
host: '127.0.0.1',
port: 3306,
user: 'tt',
password: 'password',
database: 'tt',
host: process.env.MYSQL_HOST,
port: process.env.MYSQL_PORT,
user: process.env.MYSQL_USER,
password: process.env.MYSQL_PASSWORD,
database: process.env.MYSQL_DATABASE,
},
migrations: {
tableName: 'knex_migrations'
Expand Down

0 comments on commit a85fb59

Please sign in to comment.