Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating external readmes #104

Merged
merged 1 commit into from
Oct 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 25 additions & 24 deletions _includes/readmes/loopback-android-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,42 @@ LoopBack Open Node.js Mobile API Middle tier.

## Setting up the Development Environment

1. Install [Eclipse Android Development Tools](http://developer.android.com/sdk/index.html)
1. Open Window > Android SDK Manager, make sure you have these modules
installed:
* Tools > Android SDK Platform-tools 18 or newer
* Tools > Android SDK Build-tools 18 or newer
* Android 4.3 (API 18) > SDK Platform
* Extras > Google Play Services
1. Import the Android project in this directory:
* Run File > Import
* Select Android > Existing Android Code Into Workspace
* Choose the directory where you have the Getting Started application.
* Select LoopBackExample for import
1. Import Google Play services library project into your workspace. The
project is located inside the directory where you have installed i
the Android SDK.
1. Install [Eclipse Android Development Tools](http://developer.android.com/sdk/index.html)
1. Open Window > Android SDK Manager, make sure you have these modules
installed:
* Tools > Android SDK Platform-tools 18 or newer
* Tools > Android SDK Build-tools 18 or newer
* Android 4.3 (API 18) > SDK Platform
* Extras > Google Play Services
1. Import the Android project in this directory:
* Run File > Import
* Select Android > Existing Android Code Into Workspace
* Choose the directory where you have the Getting Started application.
* Select LoopBackExample for import
1. Import Google Play services library project into your workspace. The
project is located inside the directory where you have installed i
the Android SDK.
* Run File > Import
* Select Android > Existing Android Code Into Workspace
* Go to
```
<android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/
```

```
<android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/
```
* Select google-play-services_lib for import
* Check "Copy projects into workspace"
* Click "Finish".

See this page for more details:
[Set Up Google Play Services SDK](http://developer.android.com/google/play-services/setup.html)
1. Add google-play-services\_lib as a build dependency of the Guide Application
See this page for more details:
[Set Up Google Play Services SDK](http://developer.android.com/google/play-services/setup.html)
1. Add google-play-services\_lib as a build dependency of the Guide Application
* In the Package Explorer, select LoopbackGuideApplication
* Run File &gt; Project Properties
* Select Android
* In the Library frame, click on "Add..." and select google-play-services_lib
1. Obtain an API key for Google Maps Android API v2
[instructions](https://developers.google.com/maps/documentation/android/start#obtaining_an_api_key)
and enter it into AndroidManifest.xml.
1. Obtain an API key for Google Maps Android API v2
[instructions](https://developers.google.com/maps/documentation/android/start#obtaining_an_api_key)
and enter it into AndroidManifest.xml.

---

Expand Down
42 changes: 21 additions & 21 deletions _includes/readmes/loopback-example-access-control.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#loopback-example-access-control
# loopback-example-access-control

```
$ git clone https://github.com/strongloop/loopback-example-access-control
Expand All @@ -19,28 +19,28 @@ LoopBack. The application consists of four types of users:
Each user type has permission to perform tasks based on their role and the
application's ACL (access control list) entries.

##Prerequisites
## Prerequisites

###Tutorials
### Tutorials

- [Getting started with LoopBack](http://docs.strongloop.com/display/LB/Getting+started+with+LoopBack)
- [Tutorial series - step 1](https://github.com/strongloop/loopback-example#step-one---the-basics)
- [Tutorial series - step 2](https://github.com/strongloop/loopback-example#step-two---relations-and-filter)
- [Tutorial series - step 3](https://github.com/strongloop/loopback-example#step-three---adding-application-logic)

###Knowledge
### Knowledge

- [EJS](https://github.com/visionmedia/ejs)
- [body-parser](https://github.com/expressjs/body-parser)
- [JSON](http://json.org/)
- [LoopBack models](http://docs.strongloop.com/display/LB/Defining+models)
- [LoopBack adding application logic](http://docs.strongloop.com/display/LB/Adding+application+logic)

##Procedure
## Procedure

###Create the application
### Create the application

####Application information
#### Application information

- Name: `loopback-example-access-control`
- Directory to contain the project: `loopback-example-access-control`
Expand All @@ -51,9 +51,9 @@ $ slc loopback loopback-example-access-control
$ cd loopback-example-access-control
```

###Add the models
### Add the models

####Model information
#### Model information
- Name: `user`
- Datasource: `db (memory)`
- Base class: `User`
Expand Down Expand Up @@ -94,17 +94,17 @@ $ slc loopback:model user
... # follow the prompts, repeat for `team` and `project`
```

###Define the remote methods
### Define the remote methods

Define three remote methods in [`project.js`](https://github.com/strongloop/loopback-example-access-control/blob/master/common/models/project.js):

- [`listProjects`](https://github.com/strongloop/loopback-example-access-control/blob/master/common/models/project.js#L2-L13)
- [`donate`](https://github.com/strongloop/loopback-example-access-control/blob/master/common/models/project.js#L15-L31)
- [`withdraw`](https://github.com/strongloop/loopback-example-access-control/blob/master/common/models/project.js#L33-54)

###Create the model relations
### Create the model relations

####Model relation information
#### Model relation information

- `user`
- has many
Expand All @@ -128,7 +128,7 @@ Define three remote methods in [`project.js`](https://github.com/strongloop/loop
- Property name for the relation: `user`
- Custom foreign key: `ownerId`

###Add model instances
### Add model instances

Create a boot script named [`sample-models.js`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/boot/sample-models.js).

Expand All @@ -143,7 +143,7 @@ This script does the following:
- [Creates a role named `admin` and adds a role mapping to make `Bob` an
`admin`](/server/boot/sample-models.js#L50-L65)

###Configure server-side views
### Configure server-side views

> LoopBack comes preconfigured with EJS out-of-box. This means we can use
> server-side templating by simply setting the proper view engine and a
Expand All @@ -160,7 +160,7 @@ Create [`index.ejs` in the views directory](https://github.com/strongloop/loopba
[Configure `server.js`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/server.js#L11-L20) to use server-side
templating. Remember to import the [`path`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/server.js#L4) package.

###Add routes
### Add routes

Create [`routes.js`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/boot/routes.js). This script does the following:

Expand All @@ -171,13 +171,13 @@ Create [`routes.js`](https://github.com/strongloop/loopback-example-access-contr

> When you log in sucessfully, `projects.html` is rendered with the authenticated user's access token embedded into each link.

###Create the views
### Create the views

Create the [`views` directory](https://github.com/strongloop/loopback-example-access-control/tree/master/server/views) to store views.

In this directory, create [`index.ejs`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/views/index.ejs) and [`projects.ejs`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/views/projects.ejs).

###Create a role resolver
### Create a role resolver

Create [`role-resolver.js`](https://github.com/strongloop/loopback-example-access-control/blob/master/server/boot/role-resolver.js).

Expand All @@ -186,11 +186,11 @@ Create [`role-resolver.js`](https://github.com/strongloop/loopback-example-acces
> denied. Otherwise, we check to see if the user is a team member and process
> the request accordingly.

###Create ACL entries
### Create ACL entries

> ACLs are used to restrict access to application REST endpoints.

####ACL information
#### ACL information

- Deny access to all project REST endpoints
- Select the model to apply the ACL entry to: `(all existing models)`
Expand Down Expand Up @@ -236,9 +236,9 @@ $ slc loopback:acl
# follow the prompts, repeat for each ACL listed above
```

###Try the application
### Try the application

Start the server (`node .`) and open [`localhost:3000`][localhost] in your browser to view the app. You will see logins and explanations related to each user type we created:
Start the server (`node .`) and open [`localhost:3000`](http://localhost:3000) in your browser to view the app. You will see logins and explanations related to each user type we created:

- Guest `Guest`
- Role = $everyone, $unauthenticated
Expand Down
6 changes: 3 additions & 3 deletions _includes/readmes/loopback-example-connector-rest.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[strongloop-website]: http://strongloop.com/

#loopback-example-rest-connector
# loopback-example-rest-connector

- [Overview](#Overview)
- [Running the app](#running-the-app)
Expand All @@ -19,7 +19,7 @@ this REST API.
$ git clone https://github.com/strongloop/loopback-example-rest-connector.git
$ cd loopback-example-rest-connector/external-server
$ npm install
# node .
$ node .
```
In another shell:
```
Expand All @@ -35,7 +35,7 @@ explorer or by running `curl localhost:3000/api/Magazines`.
## FAQs
The following are common questions related to using the REST connector.

##How do you perform a GET request to a remote server?
## How do you perform a GET request to a remote server?
In this example, we have a REST API exposed in [model-config.json](https://github.com/strongloop/loopback-example-rest-connector/blob/master/external-server/server/model-config.json#L31)
.

Expand Down
27 changes: 14 additions & 13 deletions _includes/readmes/loopback-example-database-oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,23 @@ cd loopback-example-database
npm install --save loopback-connector-oracle
```

> ####Automatic PATH modification
> #### Automatic PATH modification
> **⚠️ DEPRECATED loopback 1.x feature**
> During installation, you will see:
> ```
> ...
> ---------------------------------------------------------------------------
> The node-oracle module and the Oracle specific libraries have been
> installed in /Users/sh/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer.
>
> The default bashrc (/etc/bashrc) or user's bash_profile (~/.bash_profile)
> paths have been modified to use this path. If you use a shell other than
> bash, please remember to set the DYLD_LIBRARY_PATH prior to using node.
> ...
> ---------------------------------------------------------------------------
> The node-oracle module and the Oracle specific libraries have been
> installed in /Users/sh/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/loopback-oracle-installer.
>
> The default bashrc (/etc/bashrc) or user's bash_profile (~/.bash_profile)
> paths have been modified to use this path. If you use a shell other than
> bash, please remember to set the DYLD_LIBRARY_PATH prior to using node.
>
> Example:
> $ export DYLD_LIBRARY_PATH=":/Users/$USER/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/instantclient:/Users/$USER/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/instantclient"
> ...
>
> Example:
> $ export DYLD_LIBRARY_PATH=":/Users/$USER/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/instantclient:/Users/$USER/repos/loopback-example-database/node_modules/loopback-connector-oracle/node_modules/instantclient"
> ...
> ```
>
> This is a **DEPRECATED** feature from LoopBack 1.x (we will remove this
> message in a future update. Due to concerns raised in the past regarding the
Expand Down
2 changes: 1 addition & 1 deletion _includes/readmes/loopback-example-kv-connectors.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**PLEASE CREATE ISSUES AT https://github.com/strongloop/loopback/issues**
**PLEASE CREATE ISSUES AT <https://github.com/strongloop/loopback/issues>**

---

Expand Down
7 changes: 3 additions & 4 deletions _includes/readmes/loopback-example-middleware.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#loopback-example-middleware
# loopback-example-middleware
```
$ git clone git@github.com:strongloop/loopback-example-middleware.git
$ cd loopback-example-middleware
Expand All @@ -8,14 +8,13 @@ $ node .

- [How do you serve static content via static middleware?](https://github.com/strongloop/loopback-example-middleware#how-do-you-serve-static-content-via-static-middleware)

#How do you serve static content via static middleware?
## How do you serve static content via static middleware?
1. Add static middleware to the [files property](https://github.com/strongloop/loopback-example-middleware/blob/master/server/middleware.json#L17-L19) in middleware.json
2. Delete [`server/boot/root.js`](https://github.com/strongloop/loopback-example-middleware/blob/master/server/boot).
3. Create [`client/index.html`](https://github.com/strongloop/loopback-example-middleware/blob/master/client/index.html)
4. Start the server via `node .` and browse to [`localhost:3000`](http://localhost:3000). You should see `hello world` being served.


#How do you create a custom error message for all errors?
## How do you create a custom error message for all errors?
1. Create a [single function](https://github.com/strongloop/loopback-example-middleware/blob/master/server/server.js#L33-l41) that all errors are passed to.
2. Set [`app.get('remoting').errorHandler`](https://github.com/strongloop/loopback-example-middleware/blob/master/server/server.js#L23-l31) to call a custom error handler.
3. Create a [`custom error middleware`](https://github.com/strongloop/loopback-example-middleware/blob/master/server/middleware/custom-error.js) to handle errors not thrown by the `loopback.rest()` middleware.
Expand Down
2 changes: 2 additions & 0 deletions _includes/readmes/loopback-example-mixins.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Specify mixin locations relative to the `server/model-config.json` file. Multip
### npm module

This loads the [loopback-ds-timestamp-mixin](https://www.npmjs.com/package/loopback-ds-timestamp-mixin) module from the top level `node_modules` directory. Note that this module provides a mixin file `time-stamp.js` which is registered as the camel case `TimeStamp` name.

```js
{
"_meta": {
Expand All @@ -43,6 +44,7 @@ This loads the [loopback-ds-timestamp-mixin](https://www.npmjs.com/package/loopb
}
}
```

### The local `server/mixins/` directory

Because the `model-config.json` is within the `server` directory this loads the mixins from current mixins directory.
Expand Down
Loading