2011-06-13 11:23:02 +08:00
|
|
|
SQL API for cartodb.com
|
|
|
|
========================
|
|
|
|
|
2011-10-08 00:19:02 +08:00
|
|
|
Provides a nodejs based API for running SQL queries against CartoDB.
|
2011-06-13 11:23:02 +08:00
|
|
|
|
2012-03-14 02:32:01 +08:00
|
|
|
* Users are authenticated over OAuth. Also provides ability to make public
|
|
|
|
"SELECT" only calls.
|
2011-10-08 00:19:02 +08:00
|
|
|
* OAuth requests to this API should always be made over SSL.
|
2011-06-13 11:23:02 +08:00
|
|
|
|
2011-10-08 00:19:02 +08:00
|
|
|
|
2011-06-30 19:13:13 +08:00
|
|
|
core requirements
|
|
|
|
-------------
|
|
|
|
* pg_bouncer
|
|
|
|
* postgres
|
|
|
|
* redis
|
|
|
|
* node v0.4.8+
|
|
|
|
* npm
|
|
|
|
|
2012-03-14 02:32:01 +08:00
|
|
|
usage
|
|
|
|
-----
|
|
|
|
|
|
|
|
Make sure redis is running and knows about active cartodb user.
|
|
|
|
|
|
|
|
``` bash
|
|
|
|
node [cluster.js|app.js] [developement|test|production]
|
|
|
|
```
|
|
|
|
|
|
|
|
for examples of use, see /tests
|
|
|
|
|
2011-06-30 20:06:23 +08:00
|
|
|
|
2011-10-08 00:19:02 +08:00
|
|
|
dependencies
|
2012-03-14 02:32:01 +08:00
|
|
|
------------
|
2011-06-30 19:13:13 +08:00
|
|
|
|
2011-10-08 00:19:02 +08:00
|
|
|
```bash
|
|
|
|
npm install
|
|
|
|
```
|
2011-06-30 19:13:13 +08:00
|
|
|
|
2011-07-01 00:10:10 +08:00
|
|
|
|
2011-10-08 00:19:02 +08:00
|
|
|
tests
|
2012-03-14 02:32:01 +08:00
|
|
|
-----
|
2011-10-08 00:19:02 +08:00
|
|
|
``` bash
|
|
|
|
npm test-unit
|
|
|
|
npm test-acceptance
|
|
|
|
```
|
2011-06-30 19:13:13 +08:00
|
|
|
|
2012-03-14 02:32:01 +08:00
|
|
|
make sure you have setup your database connections in /config, and
|
|
|
|
have the correct databases and keys setup in redis. You'll at least
|
|
|
|
need to set redis with `HSET rails:oauth_tokens:1 user_id 1` for the
|
|
|
|
acceptance tests.
|