Closed VictorBaudot closed 6 years ago
Nope! This plugin works on hapi@16 and later. You can use pg on hapi17 with async await. Regards
Okay, so I cloned the repo, added DATABASE_URL=postgres://victor:@localhost/test
and It still crashes...
How can I make it work?
@VictorBaudot as @siarcarse suggests, this package is only compatible with Hapi versions below v17. Is your project using Hapi v16?
as i just downloaded the repo and installed the deps from package.json, yes I'm using Hapi v16
@VictorBaudot please try to run npm test
on your localhost
in the hapi-postgres-connection
directory. do tests pass?
:/ Is it because it does not find my database?
Yep. that's what it looks like ...
You appear to be on a UNIX-based system. (Linux/Mac)
Can you test your PostgreSQL connection in the terminal; run the pg_isready
you should see the following output:
/tmp:5432 - accepting connections
Yes, I'm on Linux.
I can connect to my test db with psql -d test
so it should work...
I tried to change my env export DATABASE_URL=postgres://victor:@localhost/test
multiple times with others users too but not effects
@VictorBaudot does your default postgres user not have a password?
https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING
e.g:
export DATABASE_URL=postgresql://victor:password@localhost/test
I tried with my password too but not working either.
But it finally works.
I followed these instructions and npm test is now working. Thanks for your help :)
I'm using your example and I keep getting this error:
I think that this plugin is not up-to-date with the last version of hapi :/