Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit a6d6e62

Browse files
committed
Moved example to already existing section
1 parent 3d1b430 commit a6d6e62

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,6 @@ The blueprints in this repository are meant as a starting point to make Sails wo
1313
`!` *On August 18th, [Ember Data 1.0 beta-9](http://emberjs.com/blog/2014/08/18/ember-data-1-0-beta-9-released.html) was released, including a lot of improvements for delivering model associations/relations as Embedded Records (instead of Sideloading). Embedding records is much closer to what Sails does orginally, so it might be better to move into that direction. But since the actual JSON API structure is very different for these two approaches and since most APIs will be designed to work with multiple clients, I'd like to see support/alternatives for both ways. If you happen to know a project that will support the embedded style, please send me a note!*
1414

1515

16-
### Ember Data expectations
17-
18-
Ember Data expects the JSON responses from the API to follow certain conventions.
19-
Some of these conventions are mentioned in the [Ember model guide](http://emberjs.com/guides/models/connecting-to-an-http-server/).
20-
However, there is a more [complete list of expected responses](https://stackoverflow.com/questions/14922623/what-is-the-complete-list-of-expected-json-responses-for-ds-restadapter) on Stackoverflow.
21-
22-
As a **quick example**, if you create a `post` model under the namespace `api/v1` you can access the model under `localhost:1337/api/v1/posts` and to create a new Record send a POST request using the following JSON:
23-
24-
```js
25-
{
26-
"post": {
27-
"title": "A new post"
28-
"content": "This is the wonderful content of this new post."
29-
}
30-
}
31-
```
32-
33-
34-
3516
# Getting started
3617

3718

@@ -105,6 +86,20 @@ If you want to access the REST routes with your own client or a tool like [Postm
10586
Accept: application/json
10687
Content-Type: application/json
10788

89+
Furthermore Ember Data expects the JSON responses from the API to follow certain conventions.
90+
Some of these conventions are mentioned in the [Ember model guide](http://emberjs.com/guides/models/connecting-to-an-http-server/).
91+
However, there is a more [complete list of expected responses](https://stackoverflow.com/questions/14922623/what-is-the-complete-list-of-expected-json-responses-for-ds-restadapter) on Stackoverflow.
92+
93+
As a **quick example**, if you create a `post` model under the namespace `api/v1` you can access the model under `localhost:1337/api/v1/posts` and to create a new Record send a POST request using the following JSON:
94+
95+
```js
96+
{
97+
"post": {
98+
"title": "A new post"
99+
"content": "This is the wonderful content of this new post."
100+
}
101+
}
102+
```
108103

109104

110105
# Todo

0 commit comments

Comments
 (0)