https://github.com/maxbeizer/rest_api
Phoenix REST API example
https://github.com/maxbeizer/rest_api
Last synced: about 1 year ago
JSON representation
Phoenix REST API example
- Host: GitHub
- URL: https://github.com/maxbeizer/rest_api
- Owner: maxbeizer
- Created: 2015-08-22T20:44:26.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-22T22:07:16.000Z (almost 11 years ago)
- Last Synced: 2025-03-26T21:09:20.530Z (about 1 year ago)
- Language: JavaScript
- Size: 168 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RestApi
based off of: https://renatomoya.github.io/2015/05/09/Building-a-versioned-REST-API-with-Phoenix-Framework.html
To start your new Phoenix application:
1. Install dependencies with `mix deps.get`
2. Start Phoenix endpoint with `mix phoenix.server`
Now you can visit `localhost:4000` from your browser.
## Post to the API
```
curl -H "Content-Type: application/json" -X POST -d '{"post": {"title":"foo","content":"bar"}}' http://localhost:4000/v1/posts
```