This is the server part of the Loop project. You can find more information on its APIs by looking at the online documentation
You will need Redis server installed:
apt-get install redis-server
or
yum install redis
Assuming you have brew installed, use it to install Redis:
brew install redis
If you need to restart it (after configuration update):
brew services restart redis
Then clone the Loop server and install its dependencies:
git clone https://github.com/mozilla/loop-server.git
cd loop-server && make install
You can create your configuration file in config/{NODE_ENV}.json
dev
is the environment by default. In order to run the server, you'll need to
create a dev.json
file in the config folder. You can do so by using this
command:
cp config/{sample,dev}.json
Be sure to edit the content of config/dev.json
. You'll especially need to
specify your TokBox credentials.
Once that's done, you can do:
make runserver
(which is equivalent to NODE_ENV=dev make runserver
)
make test
Redis is the default backend. The code is made to support multiple ones but only supports Redis for now.
In order to have tests working with Mac OS, make sure your ulimit
value is high enough or you will get EMFILE errors:
ulimit -S -n 2048
You should report bugs/issues or feature requests via the loop-server bugzilla component
To estimate Redis usage, checkout the repository and run the redis_usage.py
file:
./redis_usage.py [users] [daily-calls] [monthly-revocation]
For instance (for 2M users and 10 calls per day per user)
$ ./redis_usage.py 2000000 10
loop-server: v0.6.0-DEV
Usage for 2000000 users, with 10 daily calls per user and 0 monthly
revocations is 26569 MBytes
The biggest AWS ElastiCache Redis virtual machine is 68GB large so if we want to handle more that 150M users we will probably want to do some sharding to have one Redis for calls and another one for user management.
The Loop server code is released under the terms of the
Mozilla Public License v2.0. See the
LICENSE
file at the root of the repository.