Still learning web dev fundamentals so be patient with me :)
I'm trying to connect my postgres database to my web app. Per this post, I have my hooks.js connection set up like so:
export const handle = async ({event, resolve}) => {
event.locals = {
user: 'me',
host: 'localhost',
database: 'test',
password: 'password',
port: 1234,
}
const response = await resolve(event)
return response;
}
And am now trying to set up my endpoint. How can I access my db in an endpoint and set up queries? Thank you in advance for the responses or any insight.