Skip to content

Commit

Permalink
removing dummy data
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Grato committed Jul 24, 2024
1 parent 6d7e93e commit 2cfe024
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
10 changes: 0 additions & 10 deletions appserver/migrations/20230412053845_initial.js

This file was deleted.

28 changes: 14 additions & 14 deletions appserver/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ export default function Home({ dbResult }: { dbResult: string }) {
);
}

export async function getServerSideProps() {
let dbResult;
if (process.env.FLAG_USE_DB === "true") {
try {
dbResult = await knex('dummy_records').first();
dbResult = dbResult ? JSON.stringify(dbResult) : 'no rows found';
} catch (e: unknown) {
dbResult = `db error: ${String(e)}`;
}
} else {
dbResult = "FLAG_USE_DB is false";
}
return { props: { dbResult } };
}
// export async function getServerSideProps() {
// let dbResult;
// if (process.env.FLAG_USE_DB === "true") {
// try {
// dbResult = await knex('dummy_records').first();
// dbResult = dbResult ? JSON.stringify(dbResult) : 'no rows found';
// } catch (e: unknown) {
// dbResult = `db error: ${String(e)}`;
// }
// } else {
// dbResult = "FLAG_USE_DB is false";
// }
// return { props: { dbResult } };
// }
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
POSTGRES_DB: devdb
POSTGRES_PASSWORD: devdummypass
ports:
- '5432:5432'
- '5432'
volumes:
- dbdata:/var/lib/postgresql/data
healthcheck:
Expand Down

0 comments on commit 2cfe024

Please sign in to comment.