Skip to content

Commit

Permalink
added dev db hydration feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunnamius committed May 31, 2020
1 parent 5f40ac6 commit 4a60121
Show file tree
Hide file tree
Showing 7 changed files with 271 additions and 20 deletions.
4 changes: 2 additions & 2 deletions config/gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const regenTargets = [

// * CHECKENV

export const checkEnv = async (): Promise<void> => populateEnv();
export const checkEnv = async () => populateEnv();

checkEnv.description = `Throws an error if any expected environment variables are not properly set `
+ `(see expectedEnvVariables key in package.json)`;
Expand All @@ -33,7 +33,7 @@ checkEnv.description = `Throws an error if any expected environment variables ar
// ? compile this new function and once again to compile itself with the newly
// ? compiled logic. If there is an error that prevents regeneration, you can
// ? run `npm run generate` then `npm run regenerate` instead.
export const regenerate = (): NodeJS.ReadWriteStream => {
export const regenerate = () => {
populateEnv();

log(`Regenerating targets: "${regenTargets.join('" "')}"`);
Expand Down
6 changes: 6 additions & 0 deletions dist.env
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ MAX_RANKINGS_PER_ELECTION=1000
# Maximum allowed size of a request body and Content-Length header in bytes.
# Should be a string like 1kb, 1mb, 500b
MAX_CONTENT_LENGTH_BYTES=100kb

# Optional environment variable that, if !false, instructs the app to DESTROY
# the contents of the current database and replace it with dummy data when a
# client visits the index page. This will only work when NODE_ENV=development to
# protect against accidental use.
HYDRATE_DB_ON_STARTUP=false
2 changes: 1 addition & 1 deletion gulpfile.js

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

Loading

0 comments on commit 4a60121

Please sign in to comment.