Clone this repo :
git clone https://github.com/brothergiez/express-rethinkdb.git
cd express-rethinkdb && npm install
Make sure in your local machine already installed rethinkdb. (You can read this documentation for rethinkdb installation).
From your this project working directory, config your HTTP service and rethinkdb configuration:
cp .env.example .env
adjust your configuration in the .env file, then you can run the server.
npm run dev
Run via curl: Create new record :
curl --request POST \
--url http://localhost:3010/user \
--header 'content-type: application/json' \
--data '{
"username": "brothergiez",
"password": "my-password-here"
} '
Get single Record :
curl --request GET \
--url http://localhost:3010/user/your-username
Get all records :
curl --request GET \
--url http://localhost:3010/users
So it's easier to use the insomnia rest client, and copy the curl into the url field.