Pergunta

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

Foi útil?

Solução

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

Outras dicas

the code runs in a terminal window. How you open one depends on your OS.

Once you have a terminal window open you should pick a folder/directory where you want your application projects to live,

then navigate to that place in your terminal and type the commands as outlined on loopback.io site

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top