Skip to content

coryodaniel/phoenix-demo-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An elixir app for demonstrating JSONAPI (JaSerializer) with Phoenix

Set up

psql postgres
CREATE USER postgres SUPERUSER;

mix deps.get
mix ecto.create
mix ecto.migrate

mix run priv/repo/seeds.exs

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 from your browser.

Example Queries

JSONAPI Queries

Download all users

curl -X GET -H "Accept: application/vnd.api+json" -H "Cache-Control: no-cache" -H "Postman-Token: 0b58cf44-dc23-578e-7ed2-c4dcab7ed87a" "http://localhost:4000/api/users?page%5Bpage_size%5D=100000" -o users.html

List users and team names

SELECT
  email, teams.name
FROM
  users
    LEFT JOIN teams_users ON teams_users.user_id = users.id
    INNER JOIN teams ON teams_users.team_id = teams.id
ORDER BY email;

About

Just a demo project for Phoenix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published