1
0
Fork 0
mirror of https://github.com/SunRed/haste-server.git synced 2024-12-29 07:20:11 +01:00

Merge pull request #81 from pangeacake/master

Add postgres information to README.md
This commit is contained in:
John Crepezzi 2016-03-06 19:06:04 -05:00
commit 4626fd9c8d
2 changed files with 31 additions and 3 deletions

View file

@ -91,7 +91,7 @@ Where `path` represents where you want the files stored
### 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`
@ -112,6 +112,33 @@ or post.
All of which are optional except `type` with very logical default values.
### 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.
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.
This is off by default, but will constantly kick back expirations on each view
or post.
All of which are optional except `type` with very logical default values.
### Memcached
To use memcached storage you must install the `memcache` package via npm

View file

@ -19,7 +19,8 @@
"redis-url": "0.1.0",
"redis": "0.8.1",
"uglify-js": "1.3.3",
"busboy": "0.2.4"
"busboy": "0.2.4",
"pg": "4.1.1"
},
"devDependencies": {
"mocha": "*",
@ -27,7 +28,7 @@
},
"bundledDependencies": [],
"engines": {
"node": "0.8.10",
"node": "0.10.35",
"npm": "1.1.49"
},
"bin": {