A simple example of using the LoopBack KV connectors.Note: This page was generated from the loopback-example-kv-connectors/README.md.
loopback-example-kv-connectors
KeyValue connector examples.
Examples list
- IBM WebSphere eXtreme Scale with:
- KeyValue-memory with:
- Redis with:
Usage
Examples are written in the form of tests. Ensure everything is workingcorrectly by running the tests before using the code as reference.
For example, to try out the KeyValue-memory connector:
git clone https://github.com/strongloop/loopback-example-kv-connectors.git
cd loopback-example-kv-connectors/kv-memory-lb2x/
npm install
npm test
Then review the tests to understand how to use theconnector.
Third party connectors
You will need to start the corresponding servers on your local machine usingdefault application ports before running tests.
For example, to try out the Redis KeyValue connector:
git clone https://github.com/strongloop/loopback-example-kv-connectors.git
cd loopback-example-kv-connectors/redis-lb2x/
npm install
redis-server --daemonize yes # starts redis in the background
npm start
Then review the tests accordingly. To stop the Redisbackground process, find its process id and kill it:
ps aux | grep redis-server
# ...find the process id (ie. 12345)
kill 12345
We intentionally skip over configuration details like setting up data sourcesand models as these topics are already covered in our tutorials.
Tags: example_app