Search code examples
javascriptloopbackjsstrongloop

strongloop loopback slow learning curves


Kindly enlighten me of where should I really develop the code's written on this site.

http://loopback.io/#gs

I've been seeing the codes written on the web but I dont know where should I put these codes. This is my first time studying the strongloop loopback. I've been searching on some tutorial but they don't seem to tell where to put those codes.

im planning to connect to mysql on my server


Solution

  • Depending on your requirements, there could be a few steps involved.

    1. Run 'slc lb project' to scaffold a Node.js application

    2. Add models and configure the datasource. LoopBack automatically creates CRUD methods for you and expose them as REST APIs.

    3. You can drop in code into models folder to customize the model, for example:

    
        var app = require('../app');
        var MyModel = app.models.MyModel; // From models.json
        MyModel.newMethod = function() {
        ...
        };
        MyModel.prototype.anotherMethod = function() {
        ...
        };
    
    

    You can find an example at: https://github.com/strongloop-community/loopback-example-database