To run the application, follow these steps:
- Clone the repository.
- Install dependencies with
mix deps.get
. - Create a
.env.exs
environment file and add your database username and password in the format provided insample.env.exs
- Run
mix ecto.create
for creating the databases needed and run migration using commandmix ecto.migrate
. - Start the Phoenix server with
mix phx.server
.Now you can visitlocalhost:4000
from your browser.
The application should now be running, and you can make requests to the endpoints using tools like Postman or cURL.
The following routes are available:
GET /api/organizations
: Lists all organizations.POST /api/organizations
: Creates a new organization.GET /api/organizations/:id
: Retrieves a specific organization.PUT /api/organizations/:id
: Updates an existing organization.DELETE /api/organizations/:id
: Deletes an existing organization.
You can run the tests with the following command:
mix test