To start your Phoenix server:
- Run
mix setupto install and setup dependencies - Set database configuration (using postgresql)
username: "postgre_username", password: "postgre_password", hostname: "localhost", database: "database_name", - Run
mix ecto.migrateto run migration database - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
Now you can visit localhost:4000 from your browser.
POST /login| Parameter | Type | Description |
|---|---|---|
username |
string |
Required |
password |
string |
Required |
{
"username": "your username",
"password": "your password"
} POST /register| Parameter | Type | Description |
|---|---|---|
email |
string |
Required |
username |
string |
Required |
password |
string |
Required |
{
"email" : "your email",
"username": "your username",
"password": "your password"
} GET /blog GET /blog/1{"Authorization" : "Bearer token"} POST /api/v1/blog| Parameter | Type | Description |
|---|---|---|
title |
string |
Required |
body |
string |
Required |
{
"post": {
"title": "your title here",
"body": "your body here"
}
} PUT /api/v1/blog/1| Parameter | Type | Description |
|---|---|---|
title |
string |
Required |
body |
string |
Required |
{
"post": {
"title": "your title here",
"body": "your body here"
}
} DELETE /api/v1/blog/1