Skip to content

Instantly share code, notes, and snippets.

View manifoldfrs's full-sized avatar

Faris manifoldfrs

View GitHub Profile
const knex = require('knex')({
client: 'pg',
connection: {
host: '127.0.0.1',
user: '*****',
password: '**********',
database: 'espn',
},
});
/*
Overview
This is a brief overview of the process to seed data into my database for the Twitch Video Service Module.
The trickiest part was importing the sample data into the seeding file that inserts the data into the database.
I ran into issues where the seed file could not find the custom modules for the sample data, so I decided to
put the sample data into the same file as the seeding file.
*/
// package.json script in package.json
/*
Overview
This displays an api call to 'http:localhost/3049/api/videos' to retrieve all videos in the database.
The hardest part was acutally figuring out how to fetch the data properly using bookshelf syntax.
*/
app.get('/api/videos', (req, res) => {
Videos.reset()
.fetch()
.then((videos) => {
Verifying my Blockstack ID is secured with the address 1K6as63jrfoSgN1a7rWetohoa23Xmz68fP https://explorer.blockstack.org/address/1K6as63jrfoSgN1a7rWetohoa23Xmz68fP