File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -128,10 +128,16 @@ To slice resources, add `_start` and `_end`.
128
128
129
129
```
130
130
GET /:resource?_start=&_end=
131
- GET /:resource?filter=&filter=&_start=&_end=
132
131
GET /:parent/:parentId/:resource?_start=&_end=
133
132
```
134
133
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
+
135
141
To make a full-text search on resources, add ` q ` .
136
142
137
143
```
@@ -155,4 +161,4 @@ Returns default index file or content of ./public/index.html (useful if you need
155
161
## Links
156
162
157
163
* [ 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 )
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ describe('Server', function() {
104
104
. expect ( 200 , done )
105
105
} )
106
106
107
- it ( 'should reverse sorting with order =DESC' , function ( done ) {
107
+ it ( 'should reverse sorting with _order =DESC' , function ( done ) {
108
108
request ( server )
109
109
. get ( '/tags?_sort=body&_order=DESC' )
110
110
. expect ( 'Content-Type' , / j s o n / )
You can’t perform that action at this time.
0 commit comments