@@ -27,23 +27,41 @@ Or, anyone who want's their own easy to deploy/scale "backend".
27
27
If you are ` new ` to Elixir or Phoenix please
28
28
see the Learning section below.
29
29
30
- ### Try It!
30
+ ### Try It! (Heroku)
31
31
32
32
Visit: https://dwylapi.herokuapp.com/rows
33
33
34
34
Create a new Person (User)
35
35
```
36
- curl -H "Content-Type: application/json" -X POST -d '{"person": {"name":"Jimmy ","email":"[email protected] "}}' https://dwylapi.herokuapp.com/people
36
+ curl -H "Content-Type: application/json" -X POST -d '{"person": {"name":"Simon ","email":"[email protected] "}}' https://dwylapi.herokuapp.com/people
37
37
```
38
38
39
39
Now create a Row (record):
40
40
```
41
- curl -H "Content-Type: application/json" -X POST -d '{"rows": {"id":1, "title":"Hello World ","body":"This is my amazing post!", "people_id":"1 "}}' https://dwylapi.herokuapp.com/rows
41
+ curl -H "Content-Type: application/json" -X POST -d '{"rows": {"id":1, "title":"Simon Says Hi! ","body":"This is my amazing post!", "people_id":"2 "}}' https://dwylapi.herokuapp.com/rows
42
42
```
43
43
You should see your record when you visit:
44
44
https://dwylapi.herokuapp.com/rows
45
45
46
46
47
+ ### localhost
48
+
49
+ Create a new Person (User)
50
+ ```
51
+ curl -H "Content-Type: application/json" -X POST -d '{"person": {"name":"Simon","email":"[email protected] "}}' http://localhost:4000/people
52
+ ```
53
+
54
+ Now create a Row (record):
55
+ ```
56
+ curl -H "Content-Type: application/json" -X POST -d '{"rows": {"id":1, "title":"Simon Says Hi!","body":"This is my amazing post!", "people_id":"22"}}' http://localhost:4000/rows
57
+ ```
58
+
59
+ /register a new person
60
+ ```
61
+ ```
62
+ curl -H "Content-Type: application/json" -X POST -d '{"person": {"name":"Simon","email":"
[email protected] "}}'
http://localhost:4000/register
63
+ ```
64
+
47
65
48
66
## *Required* Environment Variables
49
67
@@ -65,7 +83,7 @@ To start your Phoenix app:
65
83
+ (_ Optionally_ ) Seed the database with dummy data: ` mix run priv/repo/seeds.exs `
66
84
+ Start Phoenix endpoint with ` mix phx.server `
67
85
68
- Now you can visit [ ` localhost:4000 ` ] ( http://localhost:4000 ) from your browser.
86
+ Now you can visit [ ` localhost:4000/rows ` ] ( http://localhost:4000/rows ) from your browser.
69
87
70
88
<!--
71
89
0 commit comments