我正在尝试将我的 postgres 数据库连接到我的网络应用程序。根据这篇文章,我的hooks.js连接设置如下:
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;
}
Run Code Online (Sandbox Code Playgroud)
现在我正在尝试设置我的端点。如何访问端点中的数据库并设置查询?