8/12/2023 0 Comments Loopback apiThe whole context object, which holds request and response objects. Note that query and path are aliases for form. The value is looked up using req.param, which searches route arguments, the request body and the query string. The whole request body is used as the value. Whether you like quizzing yourself with Jeopardy questions, or you’re terrible at trivia, like me, here’s how you can test this Jeopardy API using Postman. I walked through this tutorial to create a Jeopardy API using LoopBack, MongoDB, and IBM Cloud. To use the first way to specify HTTP mapping for input parameters, provide an object with a source property that has one of the values shown in the following table. LoopBack is a popular open source tool for rapidly generating NodeJS REST APIs. Provide an object with a source property. ![]() There are two ways to specify HTTP mapping for input parameters (what the method accepts): The err argument is assumed do not specify. Default is true.Īdditional notes, used by API documentation generators like Swagger.ĭescribes the remote method's callback arguments See Argument descriptions. Use false to define the method on the prototype (for example, ). Whether the method is static (for example MyModel.myMethod). One of:ĭefault HTTP status set when the callback is called without an error.ĭefault HTTP status set when the callback is called with an error.īoolean. HTTP method (verb) at which the method is available. HTTP path (relative to the model) at which the method is exposed. You can put long strings in an array if needed (see note below). ![]() Text description of the method, used by API documentation generators such as Swagger. For more info, see Argument descriptions.ĭefault if not provided is the empty array. `name` is the first argument, `age` is the second argument and callback is automatically provided by LoopBack (do not specify it in your `accepts` array). For the example above, you can see the function signature: eet(name, age, callback). ![]() These arguments map to the static method you define. Optionĭefines arguments that the remote method accepts. However, if the remote method requires arguments, you must specify accepts if the remote method returns a value, you must specify returns. All of the options properties are optional.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |