Skip to content
A simple REST Api for the knoodle-react training
JavaScript Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Knoodle API

This is a really simple REST Api for the knoodle project.


In order to make it work correctly you need the latest version of:

  • docker-ce
  • docker-compose


$ git clone
$ cd knoodle-react-api
$ make install-deps
$ make start

How to use it ?

This api provides simple endpoints:

POST /surveys

Create a new survey. This is an example of json body:

    "title": "My awesome survey !",
    "questions": [
            "title": "What's your favorite colour ?",
            "answers": [
            "title": "Do you like chocolate ?",
            "answers": [
                "It depends on my mood",
                "Chocolate ? What's that ?"

GET /surveys

Return all survey documents. You can filter results with the following filters:

Query String Values
by accept popularity, latest or empty (by title asc).
title string, the content you need in the title
offset integer. Default to 0
limit integer. Default 20

GET /surveys/:surveyId

Retrieve only one survey document.

PUT /surveys/:surveyId

Update a document. Same body as POST /surveys.

DELETE /surveys/:surveyId

Remove an existing survey.

POST /surveys/:surveyId/answers

Create an answer for a given survey. Json body must look like:

    "firstname": "John",
    "lastname": "Doe",
    "email": "",
    "answers": {
        "<questionId>": "The answer",
        "<questionId>": "The other answer"

Loading some fake data

You can load some dataset by running:

$ make load-fixtures

This command will load 30 fake surveys to the database.

You can’t perform that action at this time.