简体   繁体   English

如何将 PostgreSQL 与 hapi.js 连接

[英]How to connect PostgreSQL with hapi.js

Does anyone managed to setup with PostgreSQL with Hapi.js framework?有没有人设法使用Hapi.js框架使用PostgreSQL进行设置? I have been looking for answers to this but no avail .我一直在寻找这个问题的答案,但无济于事

I have the server all setup and ready to connect with PostgreSQL to the application.我已将服务器全部设置好并准备好将 PostgreSQL 连接到应用程序。 What is the most appropriate approach to connect the database with pg-promise ?使用pg-promise连接数据库的最合适方法是什么?

Also, what is the most efficient and shorter way of writing this code for this approach?此外,为这种方法编写此代码的最有效和简短的方法是什么?

要将pg-promise与 Hapi.js 一起使用,请参阅hapi-pg-promise

Most shorter way to connect hapi + postgreSQL is using K7 and the Sequelize connector.连接 hapi + postgreSQL 的最简短方法是使用K7和 Sequelize 连接器。 You can find an example of using it the project cart there you can see the example of using it.您可以在项目购物车中找到使用它的示例,您可以在那里看到使用它的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM