Skip to content

Commit

Permalink
Database connection: Success
Browse files Browse the repository at this point in the history
Video records retrieval: Complete
  • Loading branch information
zelihapala committed May 13, 2024
1 parent 32b98c7 commit e05b6db
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
30 changes: 22 additions & 8 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"npm": ">=10"
},
"dependencies": {
"cors": "^2.8.5",
"serverless-http": "^3.2.0"
}
}
4 changes: 2 additions & 2 deletions server/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import db from "./db.js";
const router = Router();

router.get("/videos", async (_, res) => {
const result = await db.query("SELECT 'ok' ok");
res.json(result.rows[0]);
const result = await db.query("SELECT * FROM videos");
res.json(result.rows);
});

router.get("/health", async (_, res) => {
Expand Down
1 change: 1 addition & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"author": "Code Your Future <[email protected]>",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"express": "^4.18.2",
"pg": "^8.11.3",
"serverless-http": "^3.2.0"
Expand Down

0 comments on commit e05b6db

Please sign in to comment.