Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an API endpoint without a model in Loopback?

Tags:

I understand we can create remote methods on models which will expose an endpoint. However, is there a way to expose an endpoint without a model?

For example, if I want to create an endpoint checks the version of a native app. I don't need a model to back this endpoint. The endpoint would simply check the passed in version and respond.

Does this construct exist within Loopback? Or does it need to be done within the context of Express?

like image 892
abc123 Avatar asked Jul 12 '16 03:07

abc123


People also ask

What is model in LoopBack?

A LoopBack model is a JavaScript object with both Node and REST APIs that represents data in backend systems such as databases. Models are connected to backend systems via data sources. You use the model APIs to interact with the data source to which it is attached.


1 Answers

You can use express routes as shown in Loopback's Getting Started example.

like image 98
Ritesh Jagga Avatar answered Sep 28 '22 03:09

Ritesh Jagga