• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

Node.js : RESTful APIs using StrongLoop Arc

September 1, 2015 //  by Mohamed Sanaulla//  Leave a Comment

This tutorial guides you through writing REST APIs StrongLoop Arc tool. This is an alternative to its command line tools for developing REST APIs. When you finish this tutorial, you will be able to develop REST APIs using the StrongLoop’s Arc UI composer.

In our previous post we saw how to create REST API using Loopback and MySQL by using the command line tool slc. StrongLoop also provides a UI composer for building the APIs and that UI composer is called StrongLoop Arc. In this post let us see how we can build the APIs using the UI composer.

arc

Creating empty Loopback project

First let us create an empty Loopback project using the command slc loopback:

G:\node>slc loopback

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |  Let's create a LoopBack |
   `---------´   |       application!       |
    ( _´U`_ )    '--------------------------'
    /___A___\
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

? What's the name of your application? loopback-rest-uicomposer
? Enter name of the directory to contain the project: loopback-rest-uicomposer
   create loopback-rest-uicomposer/
     info change the working directory to loopback-rest-uicomposer

And enter the name of the application as loopback-rest-uicomposer as shown above.

Once the application is created, change the directory to the app you have created now: cd loopback-rest-uicomposer. The project structure is as shown below:
loopbqack empty project

Next is to install MySQL connector for loopback by running the following command: npm install --save loopback-connector-mysql

Launching Strongloop Arc tool

Once you are in the app directory i.e in the loopback-rest-uicomposer directory, run the below command to launch the Strongloop Arc tool. It gets launched in your default browser.

G:\node\loopback-rest-uicomposer>slc arc
Loading workspace G:\node\loopback-rest-uicomposer
StrongLoop Arc is running here: http://localhost:49619/#/

And the app gets launched in the browser you will be able to see a login box. If you are first time user you would have to register at https://strongloop.com/register/ and then use the username and password to login to the application:
strongloop arc loginAfter login you will be able to see the features supported by StrongLoop Arc as shown below:

strongloop arc tools

Click on the Composer button to open the API composer UI. The composer UI looks like below:

strongloop arc composer

Creating MySQL Datasource

New datasource can be created either by clicking on the button MySQL button or the Add New Data Source link as shown below:
loopback mysql datasource

You will get an UI to configure your data source. Fill it with the connection settings as shown below:
loopbackClick on Test Connection button to test the connection. You will see Success printed beside the button as shown below:
test connectionAfter you click on Save Datasource button you will see the new datasource listed under the data source as shown below:
datasource

Creating Book Model

New model can be created by clicking on the button New or on the Add New Model link as shown below:
modelsYou will get an UI to configure your model. Fill it with the model details, properties and also select the data source as mysql as shown in the image below:
arc-1

Click on the Save Model button to find the model created and listed under the available models as shown below:
arc-2

Running the application

StrongLoop Arc provides buttons to launch the application and these are available in the top right corner as shown below:
strongloop arc example
Open the URL: http://localhost:3000/explorer/ in the browser to view the APIs available. You can test the APIs as explained in the previous article.

Conclusion

In this article we saw how we could leverage the StrongLoop Arc tool to compose the APIs visually. The Arc tool also supports the following:

  1. Building and Deploying the app
  2. Process Manager
  3. Tracing the app
  4. Profiling the app
  5. Collecting app metrics

We will explore the other features in the coming articles.

Category: NodeJSTag: NodeJS Tutorials, StrongLoop Tutorials

About Mohamed Sanaulla

In his day job he works on developing enterprise applications using ADF. He is also the moderator of JavaRanch forums and an avid blogger.

Previous Post: « Node.js : Building RESTful APIs using Loopback and MySQL
Next Post: Spring Data JPA Tutorial using Spring Boot spring data jpa»

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

New Features in Spring Boot 1.4

Difference Between @RequestParam and @PathVariable in Spring MVC

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact