So you've got a listings page up and running, but it's not getting populated with the posts sitting in your database!
I queried the database direct and the data is definitely in there - your init.sql schema is perfect and the only thing I had to innovate on beyond your README was writing node src/database/build.js to build the production database (to build the test version I had to change the database accordingly in my .env file and run this again).
I see that you have a listings.js file in your public folder. I assume your plan was/is the following:
make a fetch request from this file to a GET endpoint
which then calls a handler
which runs the getOnlyPostsTable query with SELECT * FROM POSTS
this data is then returned by the handler to the frontend
and then you inject the data to listings.html via DOM manipulation
So you've got a lot of the essential architecture in place to make this happen - it's 'just' plumbing! It looks like you've even got the HTML for the post ready to go in a tag which you could activate with JS? (I've actually never seen one of these before so have no idea how it works, but looks neat).
Don't worry too much that you haven't managed to get it plumbed together yet - getting the data flowing smoothly from frontend - backend - database - backend - frontend is no easy feat.
This is me trying to get my head round this whole process when I was a faccer.
Oh, also when I submit a new post, it's not sending me to the listings page that I see when I click 'View Offers' from the home page! I'd imagine that's to do with the action attr in your submission form.
So you've got a listings page up and running, but it's not getting populated with the posts sitting in your database!
I queried the database direct and the data is definitely in there - your init.sql schema is perfect and the only thing I had to innovate on beyond your README was writing
node src/database/build.js
to build the production database (to build the test version I had to change the database accordingly in my .env file and run this again).I see that you have a
listings.js
file in your public folder. I assume your plan was/is the following:SELECT * FROM POSTS
So you've got a lot of the essential architecture in place to make this happen - it's 'just' plumbing! It looks like you've even got the HTML for the post ready to go in a tag which you could activate with JS? (I've actually never seen one of these before so have no idea how it works, but looks neat).
Don't worry too much that you haven't managed to get it plumbed together yet - getting the data flowing smoothly from frontend - backend - database - backend - frontend is no easy feat.
This is me trying to get my head round this whole process when I was a faccer.
Oh, also when I submit a new post, it's not sending me to the listings page that I see when I click 'View Offers' from the home page! I'd imagine that's to do with the
action
attr in your submission form.