S
S
sanke462018-12-24 22:43:21
Node.js
sanke46, 2018-12-24 22:43:21

How to create a complex Rest:api [node.js]?

I am using node.js to create rest api for android app.
- for convenience I use the library: https://yeoman.io/
- for the test I use: POSTMAN
I need to create an array of chats where there are an array of messages (example on the screen)
Explain how this can be done? [www.exemple.com/messages/id_chat/id_message]

{
  "Chats" : {
    "as8v7sadfa7" : {
      "a9s8df79" : {
        "message" : "text2",
        "time" : 2340912341243,
        "userId" : 2
      },
      "a9sd8yvz98" : {
        "message" : "text",
        "time" : 2340912341243,
        "userId" : 12
      }
    },
    "av97sd8df" : {
      "a9s8dfy32" : {
        "message" : "hellow",
        "time" : 2340912341243,
        "userId" : 2
      },
      "n23b1vj2" : {
        "message" : "text text",
        "time" : 2340912341243,
        "userId" : 329
      }
    }
  }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question