Samples using the ClearRoad API for node
- Run
$ npm install
- Create a
.env
file containing:
CLEARROAD_URL=<url>
CLEARROAD_ACCESS_TOKEN=<access token>
CLEARROAD_STORAGE=memory
- Run
$ node index.js
Alternatively, you can use Google Drive as a storage account: modify options.localStorage.type
in index.js: and set it to gdrive
. You will need to get an access token as well.
- Create an app on your dropbox account that can access it on the app console
- Choose the "Dropbox API"
- Choose "App Folder"
- Name your app and click on "Create"
- Generate an access token
- Save the token in the
.env
file and set the storage asdropbox
CLEARROAD_STORAGE=dropbox
DROPBOX_ACCESS_TOKEN=<access token>
- Save your mariadb connection params in the
.env
file:
CLEARROAD_STORAGE=mariadb
DB_NAME=clearroad-api-node-samples
DB_HOST=<host>
DB_USER=<user>
DB_PASSWORD=<password>
DB_PORT=<port>
- Save your mongodb connection string in the
.env
file:
CLEARROAD_STORAGE=mongodb
DB_NAME=clearroad-api-node-samples
DB_URL=mongodb://<user>:<password>@<host>:<port>
- Save your sql server connection params in the
.env
file:
CLEARROAD_STORAGE=mssql
DB_NAME=clearroad-api-node-samples
DB_HOST=<host>
DB_USER=<user>
DB_PASSWORD=<password>
DB_USE_SSL=true/false
- Save your postgresql connection params in the
.env
file:
CLEARROAD_STORAGE=postgresql
DB_NAME=clearroad-api-node-samples
DB_HOST=<host>
DB_USER=<user>
DB_PASSWORD=<password>
DB_PORT=<port>
DB_USE_SSL=true/false