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

Remove leading slashes from examples #174

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -740,14 +740,14 @@ inside of the GET endpoint function we can get the actual value of the `_id` fro
###### CoffeeScript:
```coffeescript
# Given a URL like "/post/5"
Api.addRoute '/post/:_id',
Api.addRoute 'post/:_id',
get: ->
id = @urlParams._id # "5"
```
###### JavaScript:
```javascript
// Given a URL "/post/5"
Api.addRoute('/post/:_id', {
Api.addRoute('post/:_id', {
get: function () {
var id = this.urlParams._id; // "5"
}
Expand All @@ -761,7 +761,7 @@ parameter. If you navigate to the URL `/post/5/comments/100` then inside your en
###### CoffeeScript:
```coffeescript
# Given a URL "/post/5/comments/100"
Api.addRoute '/post/:_id/comments/:commentId',
Api.addRoute 'post/:_id/comments/:commentId',
get: ->
id = @urlParams._id # "5"
commentId = @urlParams.commentId # "100"
Expand All @@ -770,7 +770,7 @@ Api.addRoute '/post/:_id/comments/:commentId',
###### JavaScript:
```javascript
// Given a URL "/post/5/comments/100"
Api.addRoute('/post/:_id/comments/:commentId', {
Api.addRoute('post/:_id/comments/:commentId', {
get: function () {
var id = this.urlParams._id; // "5"
var commentId = this.urlParams.commentId; // "100"
Expand All @@ -783,7 +783,7 @@ If there is a query string in the URL, you can access that using `this.queryPara
###### Coffeescript:
```coffeescript
# Given the URL: "/post/5?q=liked#hash_fragment"
Api.addRoute '/post/:_id',
Api.addRoute 'post/:_id',
get: ->
id = @urlParams._id
query = @queryParams # query.q -> "liked"
Expand All @@ -792,7 +792,7 @@ Api.addRoute '/post/:_id',
###### JavaScript:
```javascript
// Given the URL: "/post/5?q=liked#hash_fragment"
Api.addRoute('/post/:_id', {
Api.addRoute('post/:_id', {
get: function () {
var id = this.urlParams._id;
var query = this.queryParams; // query.q -> "liked"
Expand Down