mirror of
https://github.com/seejohnrun/haste-server.git
synced 2024-11-01 03:21:21 +00:00
Add postgres information to README.md
This commit is contained in:
parent
6c31389327
commit
031cdd738a
1 changed files with 23 additions and 1 deletions
24
README.md
24
README.md
|
@ -91,7 +91,7 @@ Where `path` represents where you want the files stored
|
||||||
|
|
||||||
### Redis
|
### Redis
|
||||||
|
|
||||||
To use redis storage you must install the redis package in npm
|
To use redis storage you must install the `redis` package in npm
|
||||||
|
|
||||||
`npm install redis`
|
`npm install redis`
|
||||||
|
|
||||||
|
@ -106,6 +106,28 @@ Once you've done that, your config section should look like:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Postgres
|
||||||
|
|
||||||
|
To use postgres storage you must install the `pg` package in npm
|
||||||
|
|
||||||
|
`npm install pg`
|
||||||
|
|
||||||
|
Once you've done that, your config section should look like:
|
||||||
|
|
||||||
|
``` json
|
||||||
|
{
|
||||||
|
"type": "postgres",
|
||||||
|
"connectionUrl": "postgres://user:password@host:5432/database
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also just set the environment variable for `DATABASE_URL` to your database connection url.
|
||||||
|
|
||||||
|
Lastly, you will have to manually add a table to your postgres database:
|
||||||
|
|
||||||
|
`create table entries (id serial primary key, key varchar(255) not null, value text not null, expiration int, unique(key));`
|
||||||
|
|
||||||
|
|
||||||
You can also set an `expire` option to the number of seconds to expire keys in.
|
You can also set an `expire` option to the number of seconds to expire keys in.
|
||||||
This is off by default, but will constantly kick back expirations on each view
|
This is off by default, but will constantly kick back expirations on each view
|
||||||
or post.
|
or post.
|
||||||
|
|
Loading…
Reference in a new issue