This guide assumes you have some understanding of NodeJS and have it installed on your machine.
Lets get started:
rethinkdb --bind all &
visit http://localhost:8080/ to see the admin console
Getting started with Express
You can find an example of this code on github: https://github.com/b-rucel/rethinkdb_express
This is the directory structure of the finished application, that you will be building.
Lets setup the application structure and directories to work out of.
Install node modules for this app
Here are some configuration files for git and js-beautify, that I like to use in most of my projects.
For production update with your own settings and close rethinkdb ports from the public.
Using the configuration file create a DB connection middleware. This will be used throughout the API’s to query the database. Note that it’s set as a property of the request object.
Now that we have all of the dependencies out of the way we can dive into writing the API code. We will be building a Create, Read, Update, and Delete (CRUD) endpoints for users.
Express application configuration to run the API.
Create the routes for this application: this is where the CRUD logic will go. user input validation and business logic will be placed here.