Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smddzcy/simple-phoenix-rest-api
Start point for a simple Phoenix REST API.
https://github.com/smddzcy/simple-phoenix-rest-api
elixir elixir-lang elixir-programming-language json-api phoenix rest rest-api
Last synced: 8 days ago
JSON representation
Start point for a simple Phoenix REST API.
- Host: GitHub
- URL: https://github.com/smddzcy/simple-phoenix-rest-api
- Owner: smddzcy
- License: mit
- Created: 2017-02-01T10:14:14.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-01T10:34:05.000Z (almost 8 years ago)
- Last Synced: 2024-11-15T14:29:10.119Z (2 months ago)
- Topics: elixir, elixir-lang, elixir-programming-language, json-api, phoenix, rest, rest-api
- Language: Elixir
- Size: 64.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Phoenix REST API
Start point for a simple Phoenix REST API. Project includes a ready-to-use `/posts` endpoint, which is generated by `mix phoenix.gen.json`.
## Example Requests with CURL
### List
```
curl http://localhost:4000/posts
```### Create
```
curl -X POST \
-H "Content-Type: application/json" \
-d '{"post": {"title":"Post Title","content":"Post Content"} }' \
http://localhost:4000/posts
```### Show
```
curl http://localhost:4000/posts/{id}
```### Update
```
curl -X PUT \
-H "Content-Type: application/json" \
-d '{"post": {"title":"New Title","content":"New Content"} }' \
http://localhost:4000/posts/{id}
```### Delete
```
curl -X DELETE \
http://localhost:4000/posts/{id}
```## Development
To start your Phoenix app:
* Install dependencies with `mix deps.get`
* Create and migrate your database with `mix ecto.create && mix ecto.migrate`
* Start Phoenix endpoint with `mix phoenix.server`Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
## Production
[Check the deployment guides](http://www.phoenixframework.org/docs/deployment) to run in production.
## Learn more
* Official website: http://www.phoenixframework.org/
* Guides: http://phoenixframework.org/docs/overview
* Docs: https://hexdocs.pm/phoenix
* Mailing list: http://groups.google.com/group/phoenix-talk
* Source: https://github.com/phoenixframework/phoenix