And then put it under common or server as appropriate. Of course you can name the folder however you'd like: src, helpers, support, whatever. And I include them as needed: const HelperClass = require('./src/HelperClass') This tutorial shows you how to create a new LoopBack project by using the command line in IBM API Connect Version 5.0.7 and later. If you need, You can write native queries for atleast mongodb, and mysql (I haven't checked all connectors). The default ORM is capable of handling basic crud and querying across different datasources. A datasource is the configuration for this connector, which makes it usable with LoopBack. Whatever you wish to do with express, can be done with loopback. A LoopBack connector is a database or service specific library exposing the standard LoopBack connector API. So when I ran into this same problem in Loopback, I just created a src directory under server and that's where I put some helper classes that don't seem to fit anywhere else. 3 Answers Sorted by: 36 As you've pointed out, Loopback is built on top of express. And if your code doesn't fit into any of those categories, they give you a place for that too: I don't have experience with a lot of web frameworks, but one framework I have used is Grails, which is very opinionated and gives you a place for just about everything. You can use mixins to perform different common actions on models such as observing changes using operation hooks and adding model attributes.īut what about code that simply doesn't fit into any of those categories? And as Dharmendra Yadav said, mixins can be another option: That's a great answer if you have custom functions for a particular model, boot script, or middleware.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |