StrongLoop supports the following operating systems:
LoopBack is an open-source project that is available for free (without support) and a commercial version with full support is also available as part of IBM API Connect .
Yes! The LoopBack Google Group is a place for developers to ask questions and discuss LoopBack and how they are using it. Check it out!
There is also a LoopBack Gitter channel for realtime discussions with fellow LoopBack developers.
StrongLoop also publishes a blog with topics relevant to LoopBack. See Blog posts for a list of the latest posts.
LoopBack has three client SDKs for accessing the REST API services generated by the LoopBack framework:
LoopBack provides numerous connectors to access enterprise and other backend data systems.
Database connectors:
Other connectors:
Additionally, there are community connectors created by developers in the LoopBack open source community.
If the URL loads fine in a browser, but when you make a curl request to your app you get the error:
curl: (7) Failed to connect to localhost port 3000: Connection refused
The cause is likely to be because of incompatible IP versions between your app and curl.
Note:
On Mac OS 10.10 (Yosemite), curl uses IP v6 by default.
LoopBack, by default uses IP v4, and curl might be using IP v6.
If you see IP v6 entries in your hosts file (::1 localhost, fe80::1%lo0 localhost), it is likely that curl is making requests using IP v6.
To make request using IP v4, specify the --ipv4 option in your curl request as shown below.
$ curl http://localhost:3000 --ipv4
You can make your LoopBack app use IP v6 by specifying an IP v6 address as shown below:
app.start = function() {
// start the web server
return app.listen(3000, '::1',function() {
app.emit('started');
console.log('Web server listening at: %s', app.get('url'));
});
};
Tip:
If you are trying query filters with curl, use the -g or --globoff
option to use brackets [ and ] in request URLs.
Once you start working with LoopBack, you may have more detailed questions. Some of the most common are collected here, along with brief answers and links to the documentation for more information.
First, you have to configure a data source using the REST connector.
In the datasources.json file that configures the data source,
you can define operations against the REST API using the operations property.
For a short example, see loopback-example-rest-connector.
Yes: in in server/config.json set the remoting.rest.xml property to true.
See config.json for more information.
In brief:
Email model to the the email datasource.Email.send().See loopback-example-app-logic for a short example.
Static middleware enables an application to serve static content such as HTML, CSS, images, and client JavaScript files. To add it:
"routes" property in middleware.json.Add the following to the "files" property in middleware.json:
to serve static content from the project’s /client directory.
"loopback#static": {
"params": "$!../client"
}
Of course, change the value to use a different directory to contain static content.
See Defining middleware for more information, and loopback-example-middleware for a short example.
LoopBack models support:
LoopBack does not support using JavaScript (instead of JSON) for configuration files such as config.json, datasources.json, or model-config.json, to enable programmatic editing of the configuration via tools such as StrongLoop Arc.
See Managing users for more information and loopback-example-user-management for relevant code examples.
Note
Notes:
user.verify sends an email using the provided
options./verified route in our example.
For your app, you should configure the redirect to match your use case.type, template and user.
type - value must be email.template - the path to the template to use for the verification email.user - when provided, the information in the object will be used to in the verification link email.See step 2 in the previous question.
User.logout with the access token.Notes:
access_token in the query string of URL, the access token object will be provided in req.accessToken property in your route handler.User.resetPassword ultimately emits a resetPasswordRequest event and creates a temporary access token.resetPasswordRequest that sends an email to the registered user.
In our example, we provide a URL that redirects
the user to a password reset page authenticated with a temporary access token.Note: For the resetPasswordRequest handler callback, you are provided with an
info
object which contains information related to the user that is requesting the password reset.
If you see this error message, you need to update your version of LoopBack. This issue is fixed in LoopBack 2.14-. See LoopBack PR #1135.
If you need to use an older version of LoopBack, or want to enable these routes, you can set a property in config.json to do so.