This repository is the code and content for https://developer.nexmo.com, which includes the Nexmo documentation, API reference, SDKs, Tools & Community content. To get a Nexmo account, sign up for free at nexmo.com.
We use rspec to test Nexmo Developer.
To run all tests:
bundle exec rspecTo generate code coverage, set the COVERAGE environment variable when running the tests.
COVERAGE=1 bundle exec rspecThis will create a folder named coverage. Open index.html in this folder to view coverage statistics.
The project can be run on your laptop, either directly or using Docker. These instructions have been tested for mac.
Before you start, you need to make sure that you have:
To set up the project, clone this project and configure your settings:
$ git clone git@github.com:Nexmo/nexmo-developer.git
$ cd nexmo-developer
$ cp .env.example .env
Edit the .env file as appropriate for your platform. Then, run the following:
$ bundle install
$ rake db:create
$ rake db:migrate
$ rake db:seed
$ ./bin/yarn install
$ rails s
You should now be able to see the site on http://localhost:3000/
If you don't want to install Ruby & PostgreSQL then you can use docker to sandbox Nexmo Developer into its own containers. After you Install Docker run the following:
$ git clone git@github.com:Nexmo/nexmo-developer.git
$ cd nexmo-developer
$ cp .env.example .env
Edit the .env file as appropriate for your platform. Then, start the web server with this command:
$ docker-compose up
At this point, open your browser to http://localhost:3000/ ... and wait (it takes about 30 seconds for the first load).
To stop the server cleanly run:
$ docker-compose down
You can access the admin dashboard by visiting /admin. If you've populated data via rake db:seed you will have an admin user with the username of admin@nexmo.com and password of development.
The following is an example if you are running Nexmo Developer within a Docker container:
docker exec -it <container_id> rake db:seedNew admin users can be created by visiting /admin/users or by accessing the rails console and creating a new User like so:
User.create!(email: 'example@example.com', password: 'password', admin: true)The image may have changed, try rebuilding it with the following command:
$ docker-compose up --build
I get an exception PG::ConnectionBad - could not connect to server: Connection refused when I try to run the app.
This error indicates that PostgreSQL is not running. If you installed PostgreSQL using brew you can get information about how to start it by running:
$ brew info postgresql
Once PostgreSQL is running you'll need to create and migrate the database. See Setup for instructions.
We ❤️ contributions from everyone! It is a good idea to talk to us first if you plan to add any new functionality. Otherwise, bug reports, bug fixes and feedback on the library is always appreciated. Look at the Contributor Guidelines for more information and please follow the GitHub Flow.
This library is released under the MIT License