Skip to content

Commit 587ac74

Browse files
committed
Update README.md and test
1 parent b86bb22 commit 587ac74

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,16 @@ To slice resources, add `_start` and `_end`.
128128

129129
```
130130
GET /:resource?_start=&_end=
131-
GET /:resource?filter=&filter=&_start=&_end=
132131
GET /:parent/:parentId/:resource?_start=&_end=
133132
```
134133

134+
To sort resources, add `_sort` and `_order` (ascending order by default).
135+
136+
```
137+
GET /:resource?_sort=&_order=(ASC|DESC)
138+
GET /:parent/:parentId/:resource?_sort=&_order=(ASC|DESC)
139+
```
140+
135141
To make a full-text search on resources, add `q`.
136142

137143
```
@@ -155,4 +161,4 @@ Returns default index file or content of ./public/index.html (useful if you need
155161
## Links
156162

157163
* [Fast prototyping using Restangular and Json-server](http://bahmutov.calepin.co/fast-prototyping-using-restangular-and-json-server.html)
158-
* [grunt plugin](https://github.com/tfiwm/grunt-json-server)
164+
* [grunt plugin](https://github.com/tfiwm/grunt-json-server)

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('Server', function() {
104104
.expect(200, done)
105105
})
106106

107-
it('should reverse sorting with order=DESC', function(done) {
107+
it('should reverse sorting with _order=DESC', function(done) {
108108
request(server)
109109
.get('/tags?_sort=body&_order=DESC')
110110
.expect('Content-Type', /json/)

0 commit comments

Comments
 (0)